mscorlib(4.0.0.0) API with additions
|
Discovers the attributes of an event and provides access to event metadata. More...
Public Member Functions | |
override bool | Equals (object obj) |
Returns a value that indicates whether this instance is equal to a specified object. More... | |
override int | GetHashCode () |
Returns the hash code for this instance. More... | |
virtual MethodInfo [] | GetOtherMethods (bool nonPublic) |
Returns the methods that have been associated with the event in metadata using the .other directive, specifying whether to include non-public methods. More... | |
abstract MethodInfo | GetAddMethod (bool nonPublic) |
When overridden in a derived class, retrieves the MethodInfo object for the M:System.Reflection.EventInfo.AddEventHandler(System.Object,System.Delegate) method of the event, specifying whether to return non-public methods. More... | |
abstract MethodInfo | GetRemoveMethod (bool nonPublic) |
When overridden in a derived class, retrieves the MethodInfo object for removing a method of the event, specifying whether to return non-public methods. More... | |
abstract MethodInfo | GetRaiseMethod (bool nonPublic) |
When overridden in a derived class, returns the method that is called when the event is raised, specifying whether to return non-public methods. More... | |
MethodInfo [] | GetOtherMethods () |
Returns the public methods that have been associated with an event in metadata using the .other directive. More... | |
MethodInfo | GetAddMethod () |
Returns the method used to add an event handler delegate to the event source. More... | |
MethodInfo | GetRemoveMethod () |
Returns the method used to remove an event handler delegate from the event source. More... | |
MethodInfo | GetRaiseMethod () |
Returns the method that is called when the event is raised. More... | |
virtual void | AddEventHandler (object target, Delegate handler) |
Adds an event handler to an event source. More... | |
virtual void | RemoveEventHandler (object target, Delegate handler) |
Removes an event handler from an event source. More... | |
![]() | |
abstract object [] | GetCustomAttributes (bool inherit) |
When overridden in a derived class, returns an array of all custom attributes applied to this member. More... | |
abstract object [] | GetCustomAttributes (Type attributeType, bool inherit) |
When overridden in a derived class, returns an array of custom attributes applied to this member and identified by T:System.Type. More... | |
abstract bool | IsDefined (Type attributeType, bool inherit) |
When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. More... | |
virtual IList< CustomAttributeData > | GetCustomAttributesData () |
Returns a list of T:System.Reflection.CustomAttributeData objects representing data about the attributes that have been applied to the target member. More... | |
override bool | Equals (object obj) |
Returns a value that indicates whether this instance is equal to a specified object. More... | |
override int | GetHashCode () |
Returns the hash code for this instance. More... | |
![]() | |
new string | ToString () |
Provides COM objects with version-independent access to the M:System.Object.ToString method. More... | |
![]() | |
new string | ToString () |
Provides COM objects with version-independent access to the M:System.Object.ToString method. More... | |
object [] | GetCustomAttributes (Type attributeType, bool inherit) |
Provides COM objects with version-independent access to the M:System.Reflection.MemberInfo.GetCustomAttributes(System.Type,System.Boolean) method. More... | |
object [] | GetCustomAttributes (bool inherit) |
Provides COM objects with version-independent access to the M:System.Reflection.MemberInfo.GetCustomAttributes(System.Boolean) method. More... | |
bool | IsDefined (Type attributeType, bool inherit) |
Provides COM objects with version-independent access to the M:System.Reflection.MemberInfo.IsDefined(System.Type,System.Boolean) method. More... | |
Static Public Member Functions | |
static bool | operator== (EventInfo left, EventInfo right) |
Indicates whether two T:System.Reflection.EventInfo objects are equal. More... | |
static bool | operator != (EventInfo left, EventInfo right) |
Indicates whether two T:System.Reflection.EventInfo objects are not equal. More... | |
![]() | |
static bool | operator== (MemberInfo left, MemberInfo right) |
Indicates whether two T:System.Reflection.MemberInfo objects are equal. More... | |
static bool | operator != (MemberInfo left, MemberInfo right) |
Indicates whether two T:System.Reflection.MemberInfo objects are not equal. More... | |
Public Attributes | |
override MemberTypes | MemberType => MemberTypes.Event |
Gets a T:System.Reflection.MemberTypes value indicating that this member is an event. More... | |
Properties | |
abstract EventAttributes | Attributes [get] |
Gets the attributes for this event. More... | |
virtual MethodInfo | AddMethod [get] |
Gets the T:System.Reflection.MethodInfo object for the M:System.Reflection.EventInfo.AddEventHandler(System.Object,System.Delegate) method of the event, including non-public methods. More... | |
virtual MethodInfo | RemoveMethod [get] |
Gets the MethodInfo object for removing a method of the event, including non-public methods. More... | |
virtual MethodInfo | RaiseMethod [get] |
Gets the method that is called when the event is raised, including non-public methods. More... | |
virtual Type | EventHandlerType [get] |
Gets the Type object of the underlying event-handler delegate associated with this event. More... | |
bool | IsSpecialName [get] |
Gets a value indicating whether the EventInfo has a name with a special meaning. More... | |
virtual bool | IsMulticast [get] |
Gets a value indicating whether the event is multicast. More... | |
![]() | |
abstract MemberTypes | MemberType [get] |
When overridden in a derived class, gets a T:System.Reflection.MemberTypes value indicating the type of the member — method, constructor, event, and so on. More... | |
abstract string | Name [get] |
Gets the name of the current member. More... | |
abstract Type | DeclaringType [get] |
Gets the class that declares this member. More... | |
abstract Type | ReflectedType [get] |
Gets the class object that was used to obtain this instance of MemberInfo . More... | |
virtual IEnumerable< CustomAttributeData > | CustomAttributes [get] |
Gets a collection that contains this member's custom attributes. More... | |
virtual int | MetadataToken [get] |
Gets a value that identifies a metadata element. More... | |
virtual Module | Module [get] |
Gets the module in which the type that declares the member represented by the current T:System.Reflection.MemberInfo is defined. More... | |
![]() | |
MemberTypes | MemberType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.MemberType property. More... | |
string | Name [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.Name property. More... | |
Type | DeclaringType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.DeclaringType property. More... | |
Type | ReflectedType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.ReflectedType property. More... | |
![]() | |
MemberTypes | MemberType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.EventInfo.MemberType property. More... | |
string | Name [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.Name property. More... | |
Type | DeclaringType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.DeclaringType property. More... | |
Type | ReflectedType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.ReflectedType property. More... | |
EventAttributes | Attributes [get] |
Provides COM objects with version-independent access to the P:System.Reflection.EventInfo.Attributes property. More... | |
Type | EventHandlerType [get] |
Provides COM objects with version-independent access to the P:System.Reflection.EventInfo.EventHandlerType property. More... | |
bool | IsSpecialName [get] |
Provides COM objects with version-independent access to the P:System.Reflection.EventInfo.IsSpecialName property. More... | |
bool | IsMulticast [get] |
Provides COM objects with version-independent access to the P:System.Reflection.EventInfo.IsMulticast property. More... | |
Discovers the attributes of an event and provides access to event metadata.
Definition at line 15 of file EventInfo.cs.
|
virtual |
Adds an event handler to an event source.
target | The event source. |
handler | Encapsulates a method or methods to be invoked when the event is raised by the target. |
T:System.InvalidOperationException | The event does not have a public add accessor. |
T:System.ArgumentException | The handler that was passed in cannot be used. |
T:System.MethodAccessException | In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.MemberAccessException, instead.The caller does not have access permission to the member. |
T:System.Reflection.TargetException | In the .NET for Windows Store apps or the Portable Class Library, catch T:System.Exception instead.The target parameter is null and the event is not static.-or- The T:System.Reflection.EventInfo is not declared on the target. |
Implements System.Runtime.InteropServices._EventInfo.
Reimplemented in System.Runtime.InteropServices.ComAwareEventInfo.
Definition at line 247 of file EventInfo.cs.
override bool System.Reflection.EventInfo.Equals | ( | object | obj | ) |
Returns a value that indicates whether this instance is equal to a specified object.
obj | An object to compare with this instance, or null . |
true
if obj equals the type and value of this instance; otherwise, false
.Implements System.Runtime.InteropServices._EventInfo.
Definition at line 154 of file EventInfo.cs.
|
pure virtual |
When overridden in a derived class, retrieves the MethodInfo
object for the M:System.Reflection.EventInfo.AddEventHandler(System.Object,System.Delegate) method of the event, specifying whether to return non-public methods.
nonPublic | true if non-public methods can be returned; otherwise, false . |
T:System.MethodAccessException | nonPublic is true , the method used to add an event handler delegate is non-public, and the caller does not have permission to reflect on non-public methods. |
Implements System.Runtime.InteropServices._EventInfo.
Implemented in System.Runtime.InteropServices.ComAwareEventInfo.
MethodInfo System.Reflection.EventInfo.GetAddMethod | ( | ) |
Returns the method used to add an event handler delegate to the event source.
Implements System.Runtime.InteropServices._EventInfo.
Definition at line 214 of file EventInfo.cs.
override int System.Reflection.EventInfo.GetHashCode | ( | ) |
Returns the hash code for this instance.
Implements System.Runtime.InteropServices._EventInfo.
Definition at line 162 of file EventInfo.cs.
|
virtual |
Returns the methods that have been associated with the event in metadata using the .other
directive, specifying whether to include non-public methods.
nonPublic | true to include non-public methods; otherwise, false . |
.other
directive. If there are no methods matching the specification, an empty array is returned.T:System.NotImplementedException | This method is not implemented. |
Definition at line 172 of file EventInfo.cs.
MethodInfo [] System.Reflection.EventInfo.GetOtherMethods | ( | ) |
Returns the public methods that have been associated with an event in metadata using the .other
directive.
.other
directive. If there are no such public methods, an empty array is returned.Definition at line 206 of file EventInfo.cs.
|
pure virtual |
When overridden in a derived class, returns the method that is called when the event is raised, specifying whether to return non-public methods.
nonPublic | true if non-public methods can be returned; otherwise, false . |
MethodInfo
object that was called when the event was raised.T:System.MethodAccessException | nonPublic is true , the method used to add an event handler delegate is non-public, and the caller does not have permission to reflect on non-public methods. |
Implements System.Runtime.InteropServices._EventInfo.
Implemented in System.Runtime.InteropServices.ComAwareEventInfo.
MethodInfo System.Reflection.EventInfo.GetRaiseMethod | ( | ) |
Returns the method that is called when the event is raised.
Implements System.Runtime.InteropServices._EventInfo.
Definition at line 230 of file EventInfo.cs.
|
pure virtual |
When overridden in a derived class, retrieves the MethodInfo
object for removing a method of the event, specifying whether to return non-public methods.
nonPublic | true if non-public methods can be returned; otherwise, false . |
T:System.MethodAccessException | nonPublic is true , the method used to add an event handler delegate is non-public, and the caller does not have permission to reflect on non-public methods. |
Implements System.Runtime.InteropServices._EventInfo.
Implemented in System.Runtime.InteropServices.ComAwareEventInfo.
MethodInfo System.Reflection.EventInfo.GetRemoveMethod | ( | ) |
Returns the method used to remove an event handler delegate from the event source.
Implements System.Runtime.InteropServices._EventInfo.
Definition at line 222 of file EventInfo.cs.
Indicates whether two T:System.Reflection.EventInfo objects are not equal.
left | The first object to compare. |
right | The second object to compare. |
true
if left is not equal to right ; otherwise, false
.Definition at line 144 of file EventInfo.cs.
Indicates whether two T:System.Reflection.EventInfo objects are equal.
left | The first object to compare. |
right | The second object to compare. |
true
if left is equal to right ; otherwise, false
.Definition at line 125 of file EventInfo.cs.
|
virtual |
Removes an event handler from an event source.
target | The event source. |
handler | The delegate to be disassociated from the events raised by target. |
T:System.InvalidOperationException | The event does not have a public remove accessor. |
T:System.ArgumentException | The handler that was passed in cannot be used. |
T:System.Reflection.TargetException | In the .NET for Windows Store apps or the Portable Class Library, catch T:System.Exception instead.The target parameter is null and the event is not static.-or- The T:System.Reflection.EventInfo is not declared on the target. |
T:System.MethodAccessException | In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.MemberAccessException, instead.The caller does not have access permission to the member. |
Implements System.Runtime.InteropServices._EventInfo.
Reimplemented in System.Runtime.InteropServices.ComAwareEventInfo.
Definition at line 276 of file EventInfo.cs.
override MemberTypes System.Reflection.EventInfo.MemberType => MemberTypes.Event |
Gets a T:System.Reflection.MemberTypes value indicating that this member is an event.
Definition at line 19 of file EventInfo.cs.
|
get |
Gets the T:System.Reflection.MethodInfo object for the M:System.Reflection.EventInfo.AddEventHandler(System.Object,System.Delegate) method of the event, including non-public methods.
Definition at line 34 of file EventInfo.cs.
|
get |
Gets the attributes for this event.
Definition at line 25 of file EventInfo.cs.
|
get |
Gets the Type
object of the underlying event-handler delegate associated with this event.
Type
object representing the delegate event handler.T:System.Security.SecurityException | The caller does not have the required permission. |
Definition at line 71 of file EventInfo.cs.
|
get |
Gets a value indicating whether the event is multicast.
true
if the delegate is an instance of a multicast delegate; otherwise, false
.T:System.Security.SecurityException | The caller does not have the required permission. |
Definition at line 109 of file EventInfo.cs.
|
get |
Gets a value indicating whether the EventInfo
has a name with a special meaning.
true
if this event has a special name; otherwise, false
.Definition at line 95 of file EventInfo.cs.
|
get |
Gets the method that is called when the event is raised, including non-public methods.
Definition at line 58 of file EventInfo.cs.
|
get |
Gets the MethodInfo
object for removing a method of the event, including non-public methods.
MethodInfo
object for removing a method of the event.Definition at line 46 of file EventInfo.cs.