Class ReflectionEventDescriptor<TTarget, THandler>
Definition
Namespace: StardewUI.Framework.Descriptors
Assembly: StardewUI.dll
Reflection-based implementation of an event descriptor.
public class ReflectionEventDescriptor<TTarget, THandler> :
StardewUI.Framework.Descriptors.IEventDescriptor,
StardewUI.Framework.Descriptors.IMemberDescriptor
Type Parameters
TTarget
The type that declares the event.
THandler
The event handler (delegate) type.
Inheritance
Object ⇦ ReflectionEventDescriptor<TTarget, THandler>
Implements
IEventDescriptor, IMemberDescriptor
Members
Properties
Name | Description |
---|---|
ArgsTypeDescriptor | Descriptor for the type of event object (arguments), generally a subtype of EventArgs. |
DeclaringType | The type on which the member is declared. |
DelegateParameterCount | Number of parameters that the Invoke method of the DelegateType accepts. |
DelegateType | The type (subtype of Delegate) that can be added/removed from the event handlers. |
Name | The member name. |
Methods
Name | Description |
---|---|
Add(Object, Delegate) | Adds an event handler. |
Equals(Object) | (Overrides Object.Equals(Object) ) |
GetHashCode() | (Overrides Object.GetHashCode() ) |
Remove(Object, Delegate) | Removes an event handler. |
Details
Properties
ArgsTypeDescriptor
Descriptor for the type of event object (arguments), generally a subtype of EventArgs.
Property Value
DeclaringType
The type on which the member is declared.
Property Value
DelegateParameterCount
Number of parameters that the Invoke
method of the DelegateType accepts.
Property Value
DelegateType
The type (subtype of Delegate) that can be added/removed from the event handlers.
Property Value
Name
The member name.
Property Value
Methods
Add(Object, Delegate)
Adds an event handler.
Parameters
target
Object
The instance of the DeclaringType on which to subscribe to events.
handler
Delegate
The handler to run when the event is raised; must be assignable to the DelegateType.
Equals(Object)
Parameters
obj
Object
Returns
GetHashCode()
Returns
Remove(Object, Delegate)
Removes an event handler.
Parameters
target
Object
The instance of the DeclaringType on which to unsubscribe from events.
handler
Delegate
The handler that was previously registered, i.e. via Add(Object, Delegate).