NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

EventInfo Class

Reflects an event.

Implementation of this class is not complete for this release of the NGWS SDK. This documentation is for information only.

Object
   MemberInfo
      EventInfo

[Visual Basic]
MustInherit Public Class EventInfo
   Inherits MemberInfo
[C#]
public abstract class EventInfo : MemberInfo
[C++]
public __gc __abstract class EventInfo : public MemberInfo
[JScript]
public abstract class EventInfo extends MemberInfo

Remarks

Events are used in conjunction with delegates. An event listener instantiates an event-handler delegate that is invoked whenever the event is raised by an event source. In order to connect to the event source, the event listener "adds" this delegate to the invocation list on the source. When the event is raised, the invoke method of the event-handler delegate is called. Both multicast and single-cast event notifications are supported. The "add" and "remove" methods, as well as the event-handler delegate class associated with an event must be marked in the metadata.

Delegates are object oriented function pointers. In C/C++, a function pointer is a reference to a method. In contrast to the C/C++ function pointer, a delegate contains two references: a reference to a method and a reference to an object that supports the method. An interesting property of delegates is that they can be used to invoke a method without knowing the class type that declares or inherits the method. Delegates need only know the return type and parameters list of the method.

The event model works equally well for single-cast and multicast delegates. When the delegate's invoke method is called, only a single object will have a method called on it. A multicast modifier can be applied to a delegate declaration which allows multiple methods to be called when the invoke method of the delegate is called.

Requirements

Namespace: System.Reflection

Assembly: mscorlib.dll

See Also

EventInfo Members | System.Reflection Namespace