Defining an event causes insertion of new field to the Type.

For example
public delegate char Deleg(int x, char y);
public class Class1
{
    public event Deleg Event1;
    public Deleg Event2;
    public static void Main(){}
}

The assembly tree is :
|___[CLS] Class1
| | .class public auto ansi beforefieldinit 
| |___[FLD] Event1 : private class Deleg
| |___[FLD] Event2 : public class Deleg
| |___[MET] .ctor : void()
| |___[STM] Main : void()
| |___[MET] add_Event1 : void(class Deleg)
| |___[MET] remove_Event1 : void(class Deleg)
| |___[EVT] Event1 : Deleg
|
|___[CLS] Deleg
| | .class public auto ansi sealed 
| | extends [mscorlib]System.MulticastDelegate 
| |___[MET] .ctor : void(object,native int)
| |___[MET] BeginInvoke : class [mscorlib]System.IAsyncResult(int32,char,class 
|[mscorlib]System.AsyncCallback,object)
| |___[MET] EndInvoke : char(class [mscorlib]System.IAsyncResult)
| |___[MET] Invoke : char(int32,char)


How can I distinguish normal field and a field associated with an event?
The name of the field associated with an event is not always the same as the name of 
en event
(for example System.GC defines event with name "ClearCache" and has field with name 
"m_cacheHandler")

Lukasz Wielek.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to