Exemplo n.º 1
0
        private IEventHandlerStrategy GetStrategyHandler <TEventType>(TEventType ev) where TEventType : IEvent
        {
            string                  className = ev.GetType().FullName;
            EventHandlerOption      option    = Configuration.Current.EventHandlers[className];
            EventHandlerStategyType type      = option == null ? EventHandlerStategyType.InApp : option.Type;

            switch (type)
            {
            case EventHandlerStategyType.InApp:
            default:
                return(new InAppEventHandlerStategy());
            }
        }
Exemplo n.º 2
0
        private IList <IEventHandlerStrategy> GetStrategiesHandler <TEventType>(TEventType ev) where TEventType : IEvent
        {
            IList <IEventHandlerStrategy> strategies = new List <IEventHandlerStrategy>();

            strategies.Add(new InAppEventHandlerStategy());

            string             className = ev.GetType().FullName;
            EventHandlerOption option    = Configuration.Current.EventHandlers[className];

            if (option != null && option.Type == EventHandlerStategyType.External)
            {
                strategies.Add(new ExternalEventHandlerStategy());
            }
            return(strategies);
        }