Exemplo n.º 1
0
 public void ShowBalloonTip(string title, string mesasge, BalloonIcon icon)
 {
     _icon.ShowBalloonTip(
         title,
         mesasge,
         ConvertEnum <BalloonIcon, Hardcodet.Wpf.TaskbarNotification.BalloonIcon>(icon));
 }
Exemplo n.º 2
0
        private void ShowStandardBalloon(string title, string text, string iconColour)
        {
            ChangeIcon(iconColour);

            //show balloon with custom icon
            BalloonIcon icon = BalloonIcon.Error;

            switch (iconColour)
            {
            case "red":
                icon = BalloonIcon.Error;
                break;

            case "green":
                icon = BalloonIcon.Info;
                break;

            case "yellow":
            case "grey":
                icon = BalloonIcon.Warning;
                break;
            }

            MyNotifyIcon.ShowBalloonTip(title, text, icon);
            MyNotifyIcon.ToolTipText = title;

            //hide balloon
            //MyNotifyIcon.HideBalloonTip();
        }
 /// <summary>
 /// Displays a balloon tip with the specified title,
 /// text, and icon in the taskbar for the specified time period.
 /// </summary>
 /// <param name="title">The title to display on the balloon tip.</param>
 /// <param name="message">The text to display on the balloon tip.</param>
 /// <param name="symbol">A symbol that indicates the severity.</param>
 public void ShowBalloonTip(string title, string message, BalloonIcon symbol)
 {
     lock (lockObject)
     {
         ShowBalloonTip(title, message, (BalloonFlags)symbol, IntPtr.Zero);
     }
 }
Exemplo n.º 4
0
 public void ShowNotification(string title, string content, BalloonIcon icon)
 {
     taskbarIcon.ShowBalloonTip(
         title,
         content,
         icon);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Displays a balloon tip with the specified title,
 /// text, and icon in the taskbar for the specified time period.
 /// </summary>
 /// <param name="title">The title to display on the balloon tip.</param>
 /// <param name="message">The text to display on the balloon tip.</param>
 /// <param name="symbol">A symbol that indicates the severity.</param>
 public void ShowBalloonTip(string title, string message, BalloonIcon symbol)
 {
     lock (this.SyncLock)
     {
         ShowBalloonTip(title, message, symbol.GetBalloonFlag(), IntPtr.Zero);
     }
 }
Exemplo n.º 6
0
 private void OnNotifyStatus(string message, BalloonIcon icon)
 {
     if (NotifyStatus != null)
     {
         NotifyStatus(this, new NotifyStatusEventArgs(message, icon));
     }
 }
Exemplo n.º 7
0
 private void Notify(string title, string text, BalloonIcon balloonIcon)
 {
     if (balloonIcon != BalloonIcon.Info || Properties.Settings.Default.IsNotifyWhenSuccess)
     {
         notifyIcon.ShowBalloonTip(title, text, balloonIcon);
     }
 }
 public void ShowBalloonTip(string title, string message, BalloonIcon icon)
 {
     ShowBalloonTipTriggered.Invoke(this, new ShowBalloonTipEventArgs {
         Title   = title,
         Message = message,
         Icon    = icon
     });
 }
Exemplo n.º 9
0
 public void ShowBalloonTip(string title, string message, BalloonIcon balloon)
 {
     //Icon.ShowBalloonTip(title, message, balloon);
     if (TaskbarTrayIcon != null)
     {
         TaskbarTrayIcon.ShowBalloonTip(title, message, balloon);
     }
 }
Exemplo n.º 10
0
        public void ShowCustomBalloon(string title, string message, BalloonIcon symbol = BalloonIcon.Info, PopupAnimation animation = PopupAnimation.Fade, int?timeout = 3000)
        {
            var baloon = new Balloon()
            {
                Title = title, Description = message, Icon = symbol
            };

            _taskbarIcon.ShowCustomBalloon(baloon, animation, timeout);
        }
Exemplo n.º 11
0
        public void Handle(ScriptErrorEvent message)
        {
            BalloonIcon ico = message.Level == ErrorLevel.Warning ? BalloonIcon.Warning : BalloonIcon.Error;

            if (TaskbarTrayIcon != null && shellViewModel.WindowState == WindowState.Minimized)
            {
                TaskbarTrayIcon.ShowBalloonTip("Script Error", message.Description, ico);
            }
        }
Exemplo n.º 12
0
        // Show a balloon tooltip with the passed-in message, title, and icon
        public void ShowBalloon(string message, string title, BalloonIcon balloonIcon)
        {
            iconData.uFlags      = NIF_INFO;
            iconData.szInfo      = message;
            iconData.szInfoTitle = title;
            iconData.dwInfoFlags = (int)balloonIcon;

            Shell_NotifyIcon(NIM_MODIFY, ref iconData);
        }
Exemplo n.º 13
0
        private void SetStatus(string message, BalloonIcon icon)
        {
            bool displayNotifications = false;

            bool.TryParse(System.Configuration.ConfigurationManager.AppSettings["DisplayNotifications"], out displayNotifications);
            if (displayNotifications)
            {
                taskbarIcon.ShowBalloonTip("SPSync", message, icon);
            }
        }
 public virtual void Notify(string title, string message, BalloonIcon symbol = BalloonIcon.None,
                            string soundSource = null, bool loop = false, Action <ISymbolBalloonNotify> callback = null)
 => Request.Raise(new SymbolBallonNotification
 {
     Title       = title,
     Content     = message,
     Symbol      = symbol,
     SoundSource = soundSource,
     Loop        = loop
 },
                  callback);
Exemplo n.º 15
0
 /// <summary>
 /// Display a notification to the user, while flashing the window in the taskbar if it is not focused.
 /// </summary>
 /// <param name="title">The title for the notification.</param>
 /// <param name="message">The message body for the notification.</param>
 /// <param name="icon">The icon for the notification.</param>
 private void DisplayNotification(string title, string message, BalloonIcon icon)
 {
     //Use a background thread to show a notification.
     Task.Run(() => TaskbarIcon.ShowBalloonTip(title, message, icon));
     //If the window is minimised, make sure it is visible in the taskbar.
     if (WindowState == WindowState.Minimized)
     {
         ShowInTaskbar = true;
     }
     //Flash this window until it receives focus.
     FlashWindow.Flash(this);
 }
Exemplo n.º 16
0
        /// <summary>
        /// Shows the balloon tool tip.
        /// </summary>
        /// <param name="title">The title.</param>
        /// <param name="message">The message.</param>
        /// <param name="balloonIcon">The balloon icon.</param>
        public void ShowBalloonToolTip(string title, string message, BalloonIcon balloonIcon = BalloonIcon.None)
        {
            var enumName = Enum.GetName(typeof(BalloonIcon), balloonIcon);

            Hardcodet.Wpf.TaskbarNotification.BalloonIcon taskBarBalloonIcon;

            if (!Enum.TryParse(enumName, true, out taskBarBalloonIcon))
            {
                throw new ApplicationException("Invalid balloon icon symbol.");
            }

            this.MainWindow.ShowBalloonMessage(new BalloonMessage {
                Title = title, Message = message, Icon = taskBarBalloonIcon
            });
        }
Exemplo n.º 17
0
        public void showBalloonTip_Handler(string t, string m)
        {
            string title   = t;
            string message = m;

            if (rbCustomIcon.IsChecked == true)
            {
                //just display the icon on the tray
                var icon = tb.Icon;
                tb.ShowBalloonTip(title, message, icon);
            }
            else
            {
                BalloonIcon bi = rbInfo.IsChecked == true ? BalloonIcon.Info : BalloonIcon.Error;
                tb.ShowBalloonTip(title, message, bi);
            }
        }
Exemplo n.º 18
0
        public void ShowBalloon(string title, string message, BalloonIcon icon, SystemSound sound)
        {
            //trayIcon.Visibility = Visibility.Visible;
            trayIcon.ShowBalloonTip(title, message, icon);

            if (sound != null)
            {
                sound.Play();
            }

            //Task restoreTray = new Task(new Action(() =>
            //{
            //    Thread.Sleep(7000);
            //    Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => trayIcon.VisibilitytrayIcon.Visibility = WindowState == WindowState.Minimized ? Visibility.Visible : Visibility.Hidden));
            //}));
            //restoreTray.Start();
        }
Exemplo n.º 19
0
        /// <summary>
        /// Displays a balloon tip.
        /// </summary>
        private void showBalloonTip_Click(object sender, RoutedEventArgs e)
        {
            string title   = txtBalloonTitle.Text;
            string message = txtBalloonText.Text;

            if (rbCustomIcon.IsChecked == true)
            {
                //just display the icon on the tray
                var icon = tb.Icon;
                tb.ShowBalloonTip(title, message, icon);
            }
            else
            {
                BalloonIcon bi = rbInfo.IsChecked == true ? BalloonIcon.Info : BalloonIcon.Error;
                tb.ShowBalloonTip(title, message, bi);
            }
        }
Exemplo n.º 20
0
        public static BalloonFlags smethod_3(this BalloonIcon balloonIcon_0)
        {
            switch (balloonIcon_0)
            {
            case BalloonIcon.None:
                return(BalloonFlags.None);

            case BalloonIcon.Info:
                return(BalloonFlags.Info);

            case BalloonIcon.Warning:
                return(BalloonFlags.Warning);

            case BalloonIcon.Error:
                return(BalloonFlags.Error);
            }
            throw new ArgumentOutOfRangeException("icon");
        }
Exemplo n.º 21
0
 public void ShowBalloonTip(string title, string message, BalloonIcon symbol, TimeSpan timeout)
 {
     lock (lockObject)
     {
         notifyIcon.ShowBalloonTip(title, message, symbol);
         cancelationToken.Cancel();
         var newToken = new CancellationTokenSource();
         Task.Run(async() =>
         {
             await Task.Delay(timeout);
             if (newToken.IsCancellationRequested)
             {
                 return;
             }
             notifyIcon.HideBalloonTip();
         }, newToken.Token);
         cancelationToken = newToken;
     }
 }
Exemplo n.º 22
0
        /// <summary>
        /// Gets a <see cref="BalloonFlags"/> enum value that
        /// matches a given <see cref="BalloonIcon"/>.
        /// </summary>
        public static BalloonFlags GetBalloonFlag(this BalloonIcon icon)
        {
            switch (icon)
            {
            case BalloonIcon.None:
                return(BalloonFlags.None);

            case BalloonIcon.Info:
                return(BalloonFlags.Info);

            case BalloonIcon.Warning:
                return(BalloonFlags.Warning);

            case BalloonIcon.Error:
                return(BalloonFlags.Error);

            default:
                throw new ArgumentOutOfRangeException("icon");
            }
        }
Exemplo n.º 23
0
        private void ShowBalloon(string title, string message, string iconName)
        {
            BalloonIcon icon = BalloonIcon.None;

            switch (iconName)
            {
            case "Error":
                icon = BalloonIcon.Error;
                break;

            case "Warning":
                icon = BalloonIcon.Warning;
                break;

            case "Info":
                icon = BalloonIcon.Info;
                break;
            }

            if (_notifyIcon != null)
            {
                _notifyIcon.ShowBalloonTip(title ?? "SMARTdoc Share", message, icon);
            }
        }
Exemplo n.º 24
0
        private void DispalyBalloon(string title, string message, BalloonIcon icon)
        {
            var tb = Application.Current.TryFindResource("NotifyIcon") as TaskbarIcon;

            tb?.ShowBalloonTip(title, message, icon);
        }
Exemplo n.º 25
0
 /// <summary>
 /// 標準の通知バルーンを表示します。
 /// </summary>
 /// <param name="title">タイトル</param>
 /// <param name="message">メッセージ</param>
 /// <param name="symbol">表示アイコン</param>
 private void Notify(string title, string message, BalloonIcon symbol)
 {
     _taskbarIcon.ShowBalloonTip(title, message, symbol);
 }
Exemplo n.º 26
0
 public NotificationMessage(string title, string text, BalloonIcon icon)
 {
     Title = title;
       Text = text;
       Icon = icon;
 }
Exemplo n.º 27
0
 public void PopTaskBarMessage(string message, BalloonIcon category = BalloonIcon.Info)
 {
     taskbarIcon.ShowBalloonTip("3DBean", message, category);
 }
Exemplo n.º 28
0
 /// <summary>
 /// Shows a balloon tip.
 /// </summary>
 /// <param name="notificationType">Notification type.</param>
 /// <param name="title">Title to show in the balloon tip.</param>
 /// <param name="message">Message to show in the balloon tip.</param>
 /// <param name="icon">Icon to show in the balloon tip.</param>
 private void ShowNotification(TrayNotificationEnum notificationType, string title, string message, BalloonIcon icon)
 {
     _lastNotification = notificationType;
     Tray.ShowBalloonTip(title, message, icon);
 }
Exemplo n.º 29
0
 /// <summary>
 /// 標準の通知バルーンを表示します。
 /// </summary>
 /// <param name="title">タイトル</param>
 /// <param name="message">メッセージ</param>
 /// <param name="symbol">表示アイコン</param>
 private void Notify(string title, string message, BalloonIcon symbol)
 {
     _taskbarIcon.ShowBalloonTip(title, message, symbol);
 }
Exemplo n.º 30
0
 public void ShowTaskBarPopup(string title, string message, BalloonIcon symbol)
 {
     TaskBarIcon.ShowBalloonTip(title, message, symbol);
 }
 public virtual void NotifyOnUiThread(string title, string message, BalloonIcon symbol = BalloonIcon.None,
                                      string soundSource = null, bool loop = false, Action <ISymbolBalloonNotify> callback = null)
 => RunOnUiThread(() => Notify(title, message, symbol, soundSource, loop, callback));
Exemplo n.º 32
0
 public static void ShowBalloon(string text, BalloonIcon icon)
 {
     App.TrayIcon.ShowBalloonTip(Resources.AppName, text, icon);
 }
Exemplo n.º 33
0
 private void ShowBalloonTip(string title, string text, object context = null, BalloonIcon icon = BalloonIcon.None)
 {
     balloonTipContext = context;
     taskbarIcon.ShowBalloonTip(title, text, icon);
 }
Exemplo n.º 34
0
 public void ShowBalloon(string title, string message, BalloonIcon icon = BalloonIcon.Info)
 {
     TaskBar.ShowBalloonTip(title, message, icon);
 }
Exemplo n.º 35
0
 private void Show(string title, string message, BalloonIcon icon)
 {
     _taskbarIcon.ShowBalloonTip(title, message, icon);
 }
Exemplo n.º 36
0
 public NotificationMessage(string title, string text, BalloonIcon icon)
 {
     Title = title;
     Text  = text;
     Icon  = icon;
 }
Exemplo n.º 37
0
 public void ShowBalloonTip(string title, string message, BalloonIcon symbol)
 {
     _taskbarIcon.ShowBalloonTip(title, message, symbol);
 }
Exemplo n.º 38
0
 /// <summary>
 /// Displays a balloon tip with the specified title,
 /// text, and icon in the taskbar for the specified time period.
 /// </summary>
 /// <param name="title">The title to display on the balloon tip.</param>
 /// <param name="message">The text to display on the balloon tip.</param>
 /// <param name="symbol">A symbol that indicates the severity.</param>
 public void ShowBalloonTip(string title, string message, BalloonIcon symbol)
 {
     lock (this)
     {
         ShowBalloonTip(title, message, symbol.GetBalloonFlag(), IntPtr.Zero);
     }
 }
Exemplo n.º 39
0
        // Show a balloon tooltip with the passed-in message, title, and icon
        public void ShowBalloon(string message, string title, BalloonIcon balloonIcon)
        {
            iconData.uFlags = NIF_INFO;
            iconData.szInfo = message;
            iconData.szInfoTitle = title;
            iconData.dwInfoFlags = (int)balloonIcon;

            Shell_NotifyIcon(NIM_MODIFY, ref iconData);
        }