Class EventSubscriptionService
Provides the capability to subscribe to events.
Inheritance
Implements
Namespace: Copper.Eventing.Client
Assembly: Copper.Eventing.Client.dll
Syntax
public class EventSubscriptionService : IDisposable
Constructors
View SourceEventSubscriptionService(EventHandlerProxyFactory)
Initializes a new instance of the EventSubscriptionService class.
Declaration
public EventSubscriptionService(EventHandlerProxyFactory eventHandlerProxyFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| EventHandlerProxyFactory | eventHandlerProxyFactory | The event handler proxy factory. |
Methods
View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
|
Subscribe<TEvent>(TEvent, EventReceiverBuilder)
Subscribes an event handler using the specified event receiver.
Declaration
public async Task Subscribe<TEvent>(TEvent eventHandler, EventReceiverBuilder eventReceiverBuilder)
where TEvent : class
Parameters
| Type | Name | Description |
|---|---|---|
| TEvent | eventHandler | The event handler. |
| EventReceiverBuilder | eventReceiverBuilder | The event receiver builder. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A System.Threading.Tasks.Task that represents outstanding operation. |
Type Parameters
| Name | Description |
|---|---|
| TEvent | The event contract type. |
Unsubscribe<TEvent>(TEvent)
Unsubscribes the specified event handler.
Declaration
public async Task Unsubscribe<TEvent>(TEvent eventHandler)
where TEvent : class
Parameters
| Type | Name | Description |
|---|---|---|
| TEvent | eventHandler | The event handler. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A System.Threading.Tasks.Task that represents outstanding operation. |
Type Parameters
| Name | Description |
|---|---|
| TEvent | The event contract type. |