Exemple #1
0
        private void colorRotationHelper(object parameter)
        {
            double fadeTime  = (double)parameter;
            bool   firstTime = true;

            while (true)
            {
                for (int i = 0; i < colors.Count; i++)
                {
                    List <Photon> prev;
                    if (i == 0)
                    {
                        prev = colors[colors.Count - 1];
                    }
                    else
                    {
                        prev = colors[i - 1];
                    }

                    Fader colorFader = new Fader(Name + "colorRotation", colors[i], 0, 255, fadeTime);
                    colorRotationFaders.Add(colorFader);
                    lock (c_lock)
                    {
                        colorFader.Run(new FaderDoneCallback(DoneFading));
                        Monitor.Wait(c_lock);
                    }

                    if (firstTime)
                    {
                        firstTime = false;
                        continue;
                    }

                    Fader prevFader = new Fader(Name + "colorRotation", prev, 255, 0, fadeTime);
                    colorRotationFaders.Add(prevFader);
                    lock (c_lock)
                    {
                        prevFader.Run(new FaderDoneCallback(DoneFading));
                        Monitor.Wait(c_lock);
                    }
                }
            }
        }
        private void colorRotationHelper(object parameter)
        {
            double fadeTime = (double)parameter;
            bool firstTime = true;

            while (true)
            {
                for (int i = 0; i < colors.Count; i++)
                {
                    List<Photon> prev;
                    if (i == 0)
                        prev = colors[colors.Count - 1];
                    else
                        prev = colors[i - 1];

                    Fader colorFader = new Fader(Name + "colorRotation", colors[i], 0, 255, fadeTime);
                    colorRotationFaders.Add(colorFader);
                    lock (c_lock)
                    {
                        colorFader.Run(new FaderDoneCallback(DoneFading));
                        Monitor.Wait(c_lock);
                    }

                    if (firstTime)
                    {
                        firstTime = false;
                        continue;
                    }

                    Fader prevFader = new Fader(Name + "colorRotation", prev, 255, 0, fadeTime);
                    colorRotationFaders.Add(prevFader);
                    lock (c_lock)
                    {
                        prevFader.Run(new FaderDoneCallback(DoneFading));
                        Monitor.Wait(c_lock);
                    }

                }
            }
        }
Exemple #3
0
 private void StartDownFade(object sender, EventArgs e)
 {
     _downTimer.Stop();
     downFader.Run(_parentEffect.Level);
 }