Exemplo n.º 1
0
        public PopupNotification(String Title, String Details, PopupReason reason)
        {
            InitializeComponent();

            label1.Text = Title;
            label2.Text = Details;

            if (NotifIndex < 1) NotifIndex = 1;
            else NotifIndex++;

            switch (reason)
            {
                case PopupReason.Success:
                    PN_Icon.BackgroundImage = Properties.Resources.AcceptIcon;
                    break;

                case PopupReason.Error:
                    PN_Icon.BackgroundImage = Properties.Resources.CloseIcon;
                    break;

                case PopupReason.Warning:
                    PN_Icon.BackgroundImage = Properties.Resources.WarningIcon;
                    break;

                default:
                    PN_Icon.BackgroundImage = Properties.Resources.AcceptIcon;
                    break;
            }

            CurrentIndex = NotifIndex;

            IsClosed = false;
        }
Exemplo n.º 2
0
        public void ShowPopup(String Title, String Message, PopupReason reason = PopupReason.Success)
        {
            if (Prefs.Video.ShowPopups)
            {
                PopupNotification popup = new PopupNotification(Title, Message, reason);
                popup.Location = new System.Drawing.Point(Screen.PrimaryScreen.Bounds.Width - popup.Width + 50, Screen.PrimaryScreen.Bounds.Height - (popup.GetIndex() - 1) * popup.Height - popup.Height);
                popup.Opacity = 0;
                popup.Show();

                popup.FadeOut();

                Focus();
            }
        }