Ejemplo n.º 1
0
        public void RaiseRequestProcessingEvent(PiccoloContext context)
        {
            var args = new RequestProcessingEvent {
                Context = context
            };

            RaiseEvent(_eventHandlers.RequestProcessing, args);
        }
Ejemplo n.º 2
0
        public bool RaiseRequestProcessingEvent(PiccoloContext context)
        {
            var args = new RequestProcessingEvent {
                Context = context
            };
            var stopRequestProcessing = false;

            foreach (var eventHandlerType in _eventHandlers.RequestProcessing)
            {
                var eventHandler = _objectFactory.CreateInstance <IHandle <RequestProcessingEvent> >(eventHandlerType);
                eventHandler.Handle(args);

                stopRequestProcessing = args.StopRequestProcessing;

                if (args.StopEventProcessing)
                {
                    break;
                }
            }

            return(stopRequestProcessing);
        }