Animatroller.Framework.Effect.Sweeper.TimerCallback C# (CSharp) Method

TimerCallback() private method

private TimerCallback ( object state ) : void
state object
return void
        private void TimerCallback(object state)
        {
            if (this.ended)
            {
                Pause();

                ForceValue(1.0, 1.0, 1.0, ticks);

                this.ended = false;
                return;
            }

            UpdateOutput();

            lock (lockObject)
            {
                if (++this.index1 >= this.positions)
                    this.index1 = 0;
                if (++this.index2 >= this.positions)
                    this.index2 = 0;
                if (++this.index3 >= this.positions)
                    this.index3 = 0;

                this.ticks++;

                if (++this.hitCounter >= this.positions)
                {
                    // Next iteration
                    this.iterations++;
                    this.hitCounter = 0;

                    if (this.oneShot)
                        this.ended = true;

                    NewIterationAction?.Invoke(this.iterations);
                }
            }
        }