Skip to content

Interface IEventDescriptor

Definition

Namespace: StardewUI.Framework.Descriptors
Assembly: StardewUI.dll

Describes a single event on some type.

public interface IEventDescriptor : 
    StardewUI.Framework.Descriptors.IMemberDescriptor

Implements
IMemberDescriptor

Members

Properties

Name Description
ArgsTypeDescriptor Descriptor for the type of event object (arguments), generally a subtype of EventArgs.
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.

Methods

Name Description
Add(Object, Delegate) Adds an event handler.
Remove(Object, Delegate) Removes an event handler.

Details

Properties

ArgsTypeDescriptor

Descriptor for the type of event object (arguments), generally a subtype of EventArgs.

StardewUI.Framework.Descriptors.IObjectDescriptor ArgsTypeDescriptor { get; }
Property Value

IObjectDescriptor


DelegateParameterCount

Number of parameters that the Invoke method of the DelegateType accepts.

int DelegateParameterCount { get; }
Property Value

Int32


DelegateType

The type (subtype of Delegate) that can be added/removed from the event handlers.

System.Type DelegateType { get; }
Property Value

Type


Methods

Add(Object, Delegate)

Adds an event handler.

void Add(System.Object target, System.Delegate 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.


Remove(Object, Delegate)

Removes an event handler.

void Remove(System.Object target, System.Delegate 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).