A bidirectional adapter between an event, with an arbitrary, and an EventBroker<TDelegate, TArgs, TState>, where all arguments and return values are packed in a single tuple.
Namespace: Metalama.Framework.RunTime.Events
Assembly: Metalama.Framework.dll
Syntax
public interface IEventAdapter<TDelegate, TArgs, TState> where TDelegate : DelegateType Parameters
| Name | Description |
|---|---|
| TDelegate | The event type (a Delegate). |
| TArgs | A tuple type packing event arguments. |
| TState | An opaque state stored by EventBroker<TDelegate, TArgs, TState>. |
Methods
| Name | Description |
|---|---|
| AddHandler(TDelegate, TState) | Adds a handler to the event. Typically used to register the EventBroker<TDelegate, TArgs, TState> to the event. |
| GetBrokerInvocationDelegate(EventBroker<TDelegate, TArgs, TState>) | Gets the delegate that packs the event arguments and calls Invoke(in TArgs) or InvokeByRef(ref TArgs). This delegate is then registered in the event using AddHandler(TDelegate, TState) or unregistered using RemoveHandler(TDelegate, TState). |
| InvokeHandler(TDelegate, ref TArgs, TState) | Invokes an event handler. |
| RemoveHandler(TDelegate, TState) | Removes a handler from the event. Typically used to unregister the EventBroker<TDelegate, TArgs, TState> from the event. |