public void ShowMessage(string message, string title, MessageBoxIcon icon)
        {
            Image img = null;
            Color backColor = ThemeManager.BackColor;

            switch (icon)
            {
                case MessageBoxIcon.Information:
                    img = ImageProvider.GetUser32Icon(User32Icon.Information, true);
                    break;

                case MessageBoxIcon.Warning:
                    img = ImageProvider.GetUser32Icon(User32Icon.Warning, true);
                    break;

                case MessageBoxIcon.Error:
                    img = ImageProvider.GetUser32Icon(User32Icon.Error, true);
                    break;

                case MessageBoxIcon.None:
                default:
                    break;
            }

            Dictionary<string, string> d = null;
            if (message != null)
            {
                d = new Dictionary<string, string>();
                d.Add(message, string.Empty);
            }

            TrayNotificationBox f = new TrayNotificationBox();
            f.HideDelay = 5000;
            f.AnimationType = AnimationType.None;
            f.Show(title, d, img);
        }
Ejemplo n.º 2
0
        void notifyIcon_MouseMove(object sender, MouseEventArgs e)
        {
            string info = string.Empty;
            if (!_tipActive && BuildMediaStateString(true, ref info))
            {
                _tipActive = true;

                TrayNotificationBox f = new TrayNotificationBox();
                f.HideDelay = 3000;
                f.FormClosed += new FormClosedEventHandler(f_FormClosed);
                f.ShowSimple(info, true);
            }
        }
        static void dlg_SubtitleDownloadNotify(string movieFile, string subtitleFile)
        {
            // This is for enforcing playlist refresh
            EventDispatch.DispatchEvent(LocalEvents.UpdatePlaylistNames, false);

            SetCurrentSubtitle(movieFile, string.Empty);
            SetCurrentSubtitle(movieFile, subtitleFile);

            Logger.LogTrace("A subtitle was found: {0}, for movie: {1}", subtitleFile, movieFile);

            if (ProTONEConfig.SubDownloadedNotificationsEnabled)
            {
                MainThread.Post(delegate(object x)
                {
                    TrayNotificationBox f = new TrayNotificationBox();
                    f.HideDelay = 6000;
                    f.AnimationType = AnimationType.Slide;
                    
                    f.ShowSimple(Translator.Translate("TXT_SUB_LOADED"), false);
                });
            }
        }
Ejemplo n.º 4
0
      public void NotifyGUI(string format, params object[] args)
      {
          if (MediaRenderer.DefaultInstance.HasRenderingErrors == false)
          {
             string text = Translator.Translate(format, args);
 
             MediaRenderer.DefaultInstance.DisplayOsdMessage(text);
 
             if (ProTONEConfig.MediaStateNotificationsEnabled)
             {
                 TrayNotificationBox f = new TrayNotificationBox();
                 f.HideDelay = 6000;
                 f.AnimationType = AnimationType.Dissolve;
                     f.ShowSimple(text, true);
 
                 this.Focus();
             }
         }
      }