示例#1
0
        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);
        }
示例#2
0
 public void RunEffect(Effect.IMasterBrightnessEffect effect, TimeSpan oneSweepDuration)
 {
     this.Device.RunEffect(effect, oneSweepDuration);
 }