Ejemplo n.º 1
0
        private void Process(IEnumerator <IEvent> enumerator, ProcessCompletionEvent e, IIncrementallyUpdated last = null)
        {
            if (last != null)
            {
                _incrementalUpdateSet.Remove(last);
            }
            while (enumerator.MoveNext())
            {
                var item         = enumerator.Current;
                var updateOnStep = enumerator.Current as IIncrementallyUpdated;
                if (!item.IsFired)
                {
                    item.Callbacks.Add(() => Process(enumerator, e, updateOnStep));
                    item.Schedule(this);
                    if (updateOnStep != null)
                    {
                        _incrementalUpdateSet.Add(updateOnStep);
                    }
                    return;
                }
            }

            if (!e.IsFired)  //todo
            {
                e.Fire();
            }
        }
Ejemplo n.º 2
0
        public IEvent Process(IEnumerable <IEvent> process)
        {
            if (process == null)
            {
                throw new ArgumentNullException("process");
            }
            var e = new ProcessCompletionEvent();

            Process(process.GetEnumerator(), e);
            return(e);
        }