예제 #1
0
 public RegisterEventAfter(PipelineStage pipelineStage, List <PipelineEvent> eventsToExecute,
                           PipelineEvent pipelineEvent)
 {
     this.pipelineStage   = pipelineStage;
     this.eventsToExecute = eventsToExecute;
     this.pipelineEvent   = pipelineEvent;
 }
예제 #2
0
        private void RaiseEvent(PipelineEvent @event, bool ignoreAbort = false)
        {
            var observersForEvent = (from e in ObservedEvents
                                     where e.Key == @event.GetType().FullName
                                     select e.Value).SingleOrDefault();

            if (observersForEvent == null || observersForEvent.Count == 0)
            {
                return;
            }

            foreach (var observer in observersForEvent)
            {
                _log.Verbose(string.Format(_raisingPipelineEvent, @event.Name, StageName, observer.GetType().FullName));

                observer.GetType().InvokeMember("Execute",
                                                BindingFlags.FlattenHierarchy | BindingFlags.Instance |
                                                BindingFlags.InvokeMethod | BindingFlags.Public, null,
                                                observer,
                                                new object[] { @event });

                if (Aborted && !ignoreAbort)
                {
                    return;
                }
            }
        }
        public PipelineStage WithEvent(PipelineEvent pipelineEvent)
        {
            Guard.AgainstNull(pipelineEvent, "pipelineEvent");

            PipelineEvents.Add(pipelineEvent);

            return(this);
        }
        public void Register(PipelineEvent pipelineEventToRegister)
        {
            Guard.AgainstNull(pipelineEventToRegister, "pipelineEventToRegister");

            var index = eventsToExecute.IndexOf(pipelineEvent);

            eventsToExecute.Insert(index, pipelineEventToRegister);
        }
예제 #5
0
        public PipelineStage Register(PipelineEvent pipelineEventToRegister)
        {
            Guard.AgainstNull(pipelineEventToRegister, "pipelineEventToRegister");

            var index = eventsToExecute.IndexOf(pipelineEvent);

            eventsToExecute.Insert(index + 1, pipelineEventToRegister);

            return(pipelineStage);
        }
 public RegisterEventBefore(List <PipelineEvent> eventsToExecute, PipelineEvent pipelineEvent)
 {
     this.eventsToExecute = eventsToExecute;
     this.pipelineEvent   = pipelineEvent;
 }