예제 #1
0
        /// <summary>
        /// Adds an item that pauses sequencing until a given disposable is disposed.
        /// It returns that disposable immediately, so that you store it and dispose
        /// it at any point in time. You can even dispose it before the gate is
        /// reached in the sequence.
        /// </summary>
        public static IDisposable AddLapse(this ISequencer This)
        {
            var lapse = Lapse.Create();

            This.Add(lapse);
            return(lapse);
        }
예제 #2
0
        public IDisposable Subscribe(ICompletableObserver observer)
        {
            if (!_isStarted)
            {
                _subscriptionLapse = Lapse.Create();
                _isStarted         = true;
                StartNext();
            }

            return(new CompositeDisposable(
                       Disposable.Create(Complete),
                       _subscriptionLapse.Subscribe(observer)));
        }
예제 #3
0
 /// <summary>
 /// Adds a gate that pauses sequencing until a given disposable is disposed.
 /// It passes that disposable to a lambda expression that will be invoked
 /// only when the gate is reached in the sequence, so that you may then
 /// invoke some operation/animation/tween and finally dispose the disposable
 /// once completed.
 /// </summary>
 public static object AddLapse(this ISequencer This, Action <IDisposable> action) =>
 This.Add(() => Lapse.Create(action));