コード例 #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();
                });
            }