Open.Core.EventBus.Subscribe C# (CSharp) Method

Subscribe() public method

Adds a handler for a specific event type.
public Subscribe ( Type eventType, System.Action handler ) : void
eventType System.Type The type of the event.
handler System.Action The handler to invoke when the event is fired.
return void
        public void Subscribe(Type eventType, Action handler)
        {
            // Create the storage wrapper.
            EventBusHandler item = new EventBusHandler(eventType, handler);

            // Store the wrapper.
            handlers.Add(item);
        }