Esempio n. 1
0
        static void Main(string[] args)
        {
            if (args.Length == 3)
            {
                byte red = byte.Parse(args[0]);
                byte green = byte.Parse(args[1]);
                byte blue = byte.Parse(args[2]);

                Color color = Color.FromArgb(red, green, blue);
                var mailNotifier = new MailNotifier();
                mailNotifier.Color = color;

                Console.WriteLine("Color set to " + color.Name);

            }
            else if (args.Length != 1)
            {
                return;
            }
            else if (args[0] == "rainbow")
            {
                var mailNotifier = new MailNotifier();
                Console.WriteLine("Rainbow!");
                throw new NotSupportedException();
            }
            else if (args[0] == "fade")
            {
                Console.WriteLine("Fading...");
                var mailNotifier = new MailNotifier();
                while (true)
                {
                    mailNotifier.FadeTo(Color.Red);
                    System.Threading.Thread.Sleep(150);
                    mailNotifier.FadeTo(Color.Blue);
                    System.Threading.Thread.Sleep(150);
                    mailNotifier.FadeTo(Color.Green);
                    System.Threading.Thread.Sleep(150);
                }
            }
            else
            {
                Color color = Color.FromName(args[0]);
                byte red = RoundToNotifierColorValue(color.R);
                byte green = RoundToNotifierColorValue(color.G);
                byte blue = RoundToNotifierColorValue(color.B);

                var notifierColor = Color.FromArgb(red, green, blue);

                var mailNotifier = new MailNotifier();
                mailNotifier.Color = notifierColor;

                Console.WriteLine("Color set to " + notifierColor.Name);
            }
        }
        public MailNotifierBuildStatusLight(int flashingInterval)
        {
            MailNotifier[] notifiers = MailNotifier.GetNotifiers();

            if (notifiers != null && notifiers.Length > 0)
            {
                notifier = notifiers[0];
            }

            this.flashingInterval = flashingInterval;
        }
Esempio n. 3
0
 public NotifierService()
 {
     m_mailNotifier = new MailNotifier();
     m_mailNotifier.Color = Color.White;
 }