示例#1
0
 public override void Execute()
 {
     foreach (var item in source)
     {
         BaseSubject <T> subject = (BaseSubject <T>)item;
         subject.Execute();
     }
 }
示例#2
0
        public AmbSubjectArray(params IObservable <T>[] source)
        {
            this.source = source;
            Reactor reactor = new Reactor();

            foreach (var item in source)
            {
                BaseSubject <T>      subject = (BaseSubject <T>)item;
                AmbSubjectObject <T> obj     = new AmbSubjectObject <T>(subject, this, reactor);
            }
        }
示例#3
0
            public AmbSubjectObject(BaseSubject <T> subject, BaseSubject <T> parentSubject, Reactor reactor)
            {
                this.reactor       = reactor;
                this.parentSubject = parentSubject;
                var observer =
                    new Observer <T>(
                        value => InnerExecute(value),
                        ex => { throw new Exception(ex.Message); },
                        () => { });

                this.subject = subject;
                this.subject.ColdSubscribe(observer);
            }
示例#4
0
        public TimestampedSubject(IObservable <T> source)
        {
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#5
0
        public void Start(IObservable <T1> source)
        {
            BaseSubject <T1> subject = (BaseSubject <T1>)source;

            this.subject = subject;
            var observer =
                new Observer <T1>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => { });

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#6
0
        private void ErrorExecute(Exception exception)
        {
            BaseSubject <T> secondsubject = (BaseSubject <T>)secondsource;

            this.secondsubject = secondsubject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(exception),
                    () => NotifyCompleteObservers());

            this.subscriped = secondsubject.Subscribe(observer);
        }
示例#7
0
        public MinSubjectSubjectInt(IObservable <int> source)
        {
            this.source = source;
            BaseSubject <int> subject = (BaseSubject <int>)source;

            this.subject = subject;
            var observer =
                new Observer <int>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => InnerComplete());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#8
0
        public FirstSubject(IObservable <T> source)
        {
            this.source = source;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    localvalue => InnerExecute(localvalue),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.Subscribe(observer);
        }
示例#9
0
        public ElementAtSubject(IObservable <T> source, int index)
        {
            this.source = source;
            this.index  = index;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#10
0
        public LookupSubject(IObservable <T> source, Func <T, TKey> keySelector)
        {
            this.source      = source;
            this.keySelector = keySelector;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#11
0
        public ScanSubject(IObservable <T> source, Func <T, T, T> accumulator)
        {
            this.source      = source;
            this.accumulator = accumulator;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#12
0
        public WhereSubject(IObservable <T> source, Predicate <T> predicate)
        {
            this.source    = source;
            this.predicate = predicate;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#13
0
        private ObserveOnSubject(IObservable <T> source)
        {
            base.Scheduler = new CurrentThreadScheduler();
            this.source    = source;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#14
0
        public AllSubject(IObservable <T> source, Func <T, bool> predicate)
        {
            this.source    = source;
            this.predicate = predicate;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => { });

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#15
0
        public DoSubject(IObservable <T> source, Action <T> action)
        {
            this.source = source;
            this.action = action;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#16
0
        public FinallySubject(IObservable <T> source, Action action)
        {
            this.source = source;
            this.action = action;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => InnerError(ex),
                    () => InnerComplete());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#17
0
        public ContainsSubject(IObservable <T> source, T value)
        {
            this.source = source;
            this.value  = value;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    localvalue => InnerExecute(localvalue),
                    ex => NotifyErrorObservers(ex),
                    () => InnerComplete());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#18
0
        public StartWithSubject(IObservable <T> source, T[] values)
        {
            this.source = source;
            this.values = values;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#19
0
        public GroupBySubSubject(IObservable <T> source, TKey key)
        {
            this.source = source;
            this.key    = key;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    localvalue => InnerExecute(localvalue),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#20
0
        public CatchSubject(IObservable <T> firstsource, IObservable <T> secondsource)
        {
            this.firstsource  = firstsource;
            this.secondsource = secondsource;
            BaseSubject <T> firstsubject = (BaseSubject <T>)firstsource;

            this.firstsubject = firstsubject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => ErrorExecute(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = firstsubject.ColdSubscribe(observer);
        }
示例#21
0
        public SelectManySubject(IObservable <T> source, Func <T, IEnumerable <TResult> > selector)
        {
            this.source   = source;
            this.selector = selector;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#22
0
        public SkipSubject(IObservable <T> source, int count)
        {
            this.source = source;
            this.count  = count;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    localvalue => InnerExecute(localvalue),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#23
0
        public TransformSubject(IObservable <T> source, Func <T, T> transform)
        {
            this.Scheduler = new CurrentThreadScheduler();
            this.source    = source;
            this.transform = transform;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => { OnCompleted(); });

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#24
0
        public AggregateSubject(IObservable <T> source, Func <T, T, T> accumulator)
        {
            this.Scheduler   = new CurrentThreadScheduler();
            this.source      = source;
            this.accumulator = accumulator;
            BaseSubject <T> subject = (BaseSubject <T>)source;

            this.subject = subject;
            var observer =
                new Observer <T>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => { OnCompleted(); });

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#25
0
        public ZipSubject(IObservable <TFirst> first, IEnumerable <TSecond> second, Func <TFirst, TSecond, TResult> resultSelector)
        {
            this.first          = first;
            this.second         = second;
            this.resultSelector = resultSelector;
            BaseSubject <TFirst> subject = (BaseSubject <TFirst>)first;

            this.subject = subject;
            var observer =
                new Observer <TFirst>(
                    value => InnerExecute(value),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.subscriped = subject.ColdSubscribe(observer);
        }
示例#26
0
        public AmbSubject(IObservable <T> first, IObservable <T> second)
        {
            this.first  = (BaseSubject <T>)first;
            this.second = (BaseSubject <T>)second;
            var firstobserver =
                new Observer <T>(
                    value => InnerExecuteFirst(value),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());
            var secondobserver =
                new Observer <T>(
                    value => InnerExecuteSecond(value),
                    ex => NotifyErrorObservers(ex),
                    () => NotifyCompleteObservers());

            this.firstsubscriped  = this.first.ColdSubscribe(firstobserver);
            this.secondsubscriped = this.second.ColdSubscribe(secondobserver);
        }
示例#27
0
 public DisposeObject(List <IObserver <T> > observers, BaseSubject <T> subject, IObserver <T> observer)
 {
     this.observers = observers;
     this.observer  = observer;
     this.subject   = subject;
 }