Example #1
0
        public virtual void dispose()
        {
            if (this._future != null)
            {
                var localFuture = this._future;
                this._future = null;
                D.assert(!this.isActive);
                this.unscheduleTick();
                localFuture._cancel(this);
            }

            D.assert(() => {
                this._startTime = default(TimeSpan);
                return(true);
            });
        }
Example #2
0
        public void absorbTicker(Ticker originalTicker)
        {
            D.assert(!this.isActive);
            D.assert(this._future == null);
            D.assert(this._startTime == null);
            D.assert(this._animationId == null);
            D.assert((originalTicker._future == null) == (originalTicker._startTime == null),
                     () => "Cannot absorb Ticker after it has been disposed.");
            if (originalTicker._future != null)
            {
                this._future    = originalTicker._future;
                this._startTime = originalTicker._startTime;
                if (this.shouldScheduleTick)
                {
                    this.scheduleTick();
                }

                originalTicker._future = null;
                originalTicker.unscheduleTick();
            }

            originalTicker.dispose();
        }
Example #3
0
        public void stop(bool canceled = false)
        {
            if (!this.isActive)
            {
                return;
            }

            var localFuture = this._future;

            this._future    = null;
            this._startTime = null;
            D.assert(!this.isActive);

            this.unscheduleTick();
            if (canceled)
            {
                localFuture._cancel(this);
            }
            else
            {
                localFuture._complete();
            }
        }