コード例 #1
0
        public void AddNotification(string id, string text, Action clickHandler, MobileMiner.Data.NotificationKind kind, string informationUrl = "")
        {
            NotificationControl notificationControl;

            foreach (Control control in containerPanel.Controls)
            {
                notificationControl = (NotificationControl)control;
                if ((string)notificationControl.Tag == id)
                    return;
            }

            notificationControl = new NotificationControl(text, clickHandler, (nc) => { 
                nc.Parent = null;
                if (NotificationsChanged != null)
                    NotificationsChanged(this);
            }, informationUrl);

            notificationControl.Height = 28;
            notificationControl.Parent = containerPanel;
            notificationControl.Top = Int16.MaxValue;
            notificationControl.Tag = (object)id;

            notificationControl.BringToFront();

            notificationControl.Dock = DockStyle.Top;

            containerPanel.ScrollControlIntoView(notificationControl);

            if (NotificationAdded != null)
                NotificationAdded(text, kind);

            if (NotificationsChanged != null)
                NotificationsChanged(this);           
        }
コード例 #2
0
        public void AddNotification(string id, string text, Action clickHandler, string informationUrl = "")
        {
            NotificationControl notificationControl;

            foreach (Control control in containerPanel.Controls)
            {
                notificationControl = (NotificationControl)control;
                if ((string)notificationControl.Tag == id)
                {
                    return;
                }
            }

            notificationControl = new NotificationControl(text, clickHandler, (nc) => {
                nc.Parent = null;
                if (NotificationsChanged != null)
                {
                    NotificationsChanged(this);
                }
            }, informationUrl);

            notificationControl.Height = 28;
            notificationControl.Parent = containerPanel;
            notificationControl.Top    = Int16.MaxValue;
            notificationControl.Tag    = (object)id;

            notificationControl.BringToFront();

            notificationControl.Dock = DockStyle.Top;

            containerPanel.ScrollControlIntoView(notificationControl);

            if (NotificationAdded != null)
            {
                NotificationAdded(text);
            }

            if (NotificationsChanged != null)
            {
                NotificationsChanged(this);
            }
        }