示例#1
0
文件: Tick.cs 项目: atlesg/xLayout
            public Core(FollowValue <T> followValue, IObserver <T> observer)
            {
                _observer    = observer;
                truthSub     = followValue._truth.Subscribe(truth => { destValue = truth; }, OnError, Complete);
                currentValue = destValue;

                if (truthSub != null)
                {
                    tickSub = t.Subscribe(delta =>
                    {
                        currentValue = followValue._follower(currentValue, destValue, delta);
                        observer.OnNext(currentValue);
                    });
                }
            }
示例#2
0
文件: Tick.cs 项目: atlesg/xLayout
            public CoreNonObservable(FollowValue <T> followValue, IObserver <T> observer)
            {
                destValue    = followValue.end;
                currentValue = followValue.start;

                tickSub = t.Subscribe(delta =>
                {
                    currentValue = followValue._follower(currentValue, destValue, delta);
                    observer.OnNext(currentValue);

                    if (!currentValue.Equals(destValue))
                    {
                        return;
                    }

                    observer.OnCompleted();
                    Dispose();
                });
            }