Esempio n. 1
0
        private ReplaySubject <FlowEvent> GetObservableWithElement(FlowEvent flowEvent)
        {
            var observable = new ReplaySubject <FlowEvent>();

            observable.OnNext(flowEvent);
            flowEvent.ContextOfEvent.Disposed += OnContextDisposed;
            return(observable);
        }
Esempio n. 2
0
        public void AddEvent(FlowEvent flowEvent)
        {
            if (flowEvent.ContextOfEvent == null)
            {
                throw new ArgumentException("context must be set on each event before raising it");
            }

            flowEvents.AddOrUpdate(flowEvent.ContextOfEvent,
                                   (context) => GetObservableWithElement(flowEvent), //if context does not exist create new observable
                                   (context, obs) =>                                 //If context exists, add event to context and return it
            {
                obs.OnNext(flowEvent);
                return(obs);
            });

            allFlowEventsObservable.OnNext(flowEvent);
        }
Esempio n. 3
0
 public void RaiseEvent(FlowEvent flowEvent)
 {
     eventStore.AddEvent(flowEvent);
 }
Esempio n. 4
0
 public void RaiseEventInCurrentContext(FlowEvent flowEvent)
 {
     flowEvent.ContextOfEvent = CurrentContext;
     RaiseEvent(flowEvent);
 }