/// <summary> /// Registers the handler. /// </summary> /// <typeparam name="TEvent">The type of the event.</typeparam> /// <param name="handler">The handler.</param> public void RegisterHandler <TEvent>(Action <TEvent> handler) where TEvent : Event { var castHandler = ExpressionEx.CovariantCast <Event, TEvent>(e => handler(e)); RegisterHandler(typeof(TEvent), castHandler); }