C# Class NContext.EventHandling.EventManager

Defines an application component for event handling.
Inheritance: IManageEvents
Show file Open project: PowerDMS/NContext

Public Methods

Method Description
Configure ( ApplicationConfigurationBase applicationConfiguration ) : void

Configures the component instance. This method should set IsConfigured.

EventManager ( IActivationProvider activationProvider ) : System

Initializes a new instance of the EventManager class.

Raise ( object @event ) : Task

Raises the specified event.

Protected Methods

Method Description
GetPartitionCount ( Int32 handlerCount ) : Int32

Determines the number of partitions to create for concurrent execution of processing event handlers. This will affect the number of thread-pool threads queued to execute handlers in parallel. By default, EventManager will only process a maximum of Environment.ProcessorCount (one thread per virtual processor) unless the handlerCount is less than the Environment.ProcessorCount value. In which it will partition according to the handlerCount.

Private Methods

Method Description
InvokeEventHandler ( EventHandlerInformation handlerInformation, MethodInfo createInstanceMethod, object @event ) : Task
RaiseEventInternal ( object @event ) : Task

Method Details

Configure() public method

Configures the component instance. This method should set IsConfigured.
public Configure ( ApplicationConfigurationBase applicationConfiguration ) : void
applicationConfiguration ApplicationConfigurationBase The application configuration.
return void

EventManager() public method

Initializes a new instance of the EventManager class.
public EventManager ( IActivationProvider activationProvider ) : System
activationProvider IActivationProvider The activation provider.
return System

GetPartitionCount() protected method

Determines the number of partitions to create for concurrent execution of processing event handlers. This will affect the number of thread-pool threads queued to execute handlers in parallel. By default, EventManager will only process a maximum of Environment.ProcessorCount (one thread per virtual processor) unless the handlerCount is less than the Environment.ProcessorCount value. In which it will partition according to the handlerCount.
protected GetPartitionCount ( Int32 handlerCount ) : Int32
handlerCount System.Int32
return System.Int32

Raise() public method

Raises the specified event.
public Raise ( object @event ) : Task
@event object
return Task