Animatroller.Framework.LogicalDevice.VirtualPixel1D.RunEffect C# (CSharp) Method

RunEffect() public method

public RunEffect ( Effect effect, System.TimeSpan oneSweepDuration ) : Effect.MasterSweeper.Job
effect Effect
oneSweepDuration System.TimeSpan
return Effect.MasterSweeper.Job
        public Effect.MasterSweeper.Job RunEffect(Effect.IMasterBrightnessEffect effect, TimeSpan oneSweepDuration)
        {
            var effectAction = effect.GetEffectAction(brightness =>
            {
                this.SetBrightness(brightness, this);
            });

            lock (this.lockObject)
            {
                if (this.effectJob == null)
                {
                    // Create new
                    this.effectJob = Executor.Current.RegisterSweeperJob(effectAction, oneSweepDuration, effect.Iterations);
                }
                else
                {
                    this.effectJob.Reset(effectAction, oneSweepDuration, effect.Iterations);
                }
                this.effectJob.Restart();
            }

            return this.effectJob;
        }