コード例 #1
0
ファイル: TrayIcon.cs プロジェクト: codehaus/damagecontrol
        public void ProjectPolled(object source, PolledEventArgs args)
        {
            bool onefailed    = false;
            bool onesucceeded = false;

            //NotificationFactory.ShowMessageNotification
            //("Header", "Body", NotificationType.Info, new TimerEndedHandler (TimerEnded));

            /*
             *      NotificationBubble b = new NotificationBubble ("http://www.gnome.org", NotificationSource.Url, NotificationContent.Html);
             * b.TimeOut = 10000;
             * b.TimerEndedEvent += TimerEnded;
             * b.BubbleWidth = 600;
             * b.BubbleHeight = 80;
             * b.Move (5, 30);
             * b.RenderWithTimer ();
             * b.ShowAll ();
             */

            foreach (Project proj in this.projects)
            {
                if (proj.ProjectStatus.BuildStatus == BuildStatus.Success)
                {
                    onesucceeded = true;
                }
                if (proj.ProjectStatus.BuildStatus == BuildStatus.Failure)
                {
                    onefailed = true;
                }
                if (onefailed)
                {
                    //image = new Gtk.Image(new Gdk.Pixbuf(null, "red-24.png"));
                    pixbuf       = new Gdk.Pixbuf(null, "red-24.png");
                    image.Pixbuf = pixbuf;
                    image.ShowNow();
                    return;
                }
                else if (onesucceeded)
                {
                    pixbuf       = new Gdk.Pixbuf(null, "green-24.png");
                    image.Pixbuf = pixbuf;
                    image.ShowNow();
                    return;
                }
                else
                {
                    pixbuf       = new Gdk.Pixbuf(null, "gray-24.png");
                    image.Pixbuf = pixbuf;
                    image.ShowNow();
                    Console.WriteLine("gray");
                }
            }
        }