void OnLogEvent(AppLog.LogEntry entry) { logGrid.Items.Insert(0, new LogItem(entry)); if (App.GetConfigInt("GUI", "ShowNotifications", 1) == 0) { return; } if ((entry.categoryID & (short)Priv10Logger.EventFlags.Notifications) != 0) { System.Windows.Forms.ToolTipIcon tipIcon = System.Windows.Forms.ToolTipIcon.Info; if (entry.entryType == EventLogEntryType.Error) { tipIcon = System.Windows.Forms.ToolTipIcon.Error; } else if (entry.entryType == EventLogEntryType.Warning) { tipIcon = System.Windows.Forms.ToolTipIcon.Warning; } App.TrayIcon.Notify(entry.strMessage, tipIcon); } // todo: use owne window with a log /*if ((entry.categoryID & (short)App.EventFlags.PopUpMessages) != 0) * { * MessageBoxImage boxIcon = MessageBoxImage.Information; * if (entry.entryType == EventLogEntryType.Error) * boxIcon = MessageBoxImage.Warning; * else if (entry.entryType == EventLogEntryType.Warning) * boxIcon = MessageBoxImage.Error; * MessageBox.Show(entry.strMessage, App.mName, MessageBoxButton.OK, boxIcon); * }*/ }
public LogAndErrorsUtils(System.Windows.Forms.NotifyIcon notifyIcon, System.Windows.Forms.ToolTipIcon tooltypeIcon) { m_logger = LogManager.GetCurrentClassLogger(); m_notifyIcon = notifyIcon; m_tooltypeIcon = tooltypeIcon; m_bFirstError = false; }
/// <summary> /// 显示气泡或通知(在windows7上是任务栏气泡,win10上是系统通知) /// </summary> public void BalloonTipIcon(string title, string content, System.Windows.Forms.ToolTipIcon icon = System.Windows.Forms.ToolTipIcon.None) { notifyIcon.BalloonTipTitle = title; notifyIcon.BalloonTipText = content; notifyIcon.BalloonTipIcon = icon; notifyIcon.ShowBalloonTip(5000); }
// Показать всплывающее сообщение при запуске private void ShowNotifyBaloon() { const string BaloonTitle = "Оповещения Трекера"; const string BaloonText = "Приложение успешно настроено"; const ToolTipIcon Icon = ToolTipIcon.Info; trayIcon.ShowBalloonTip(2000, BaloonTitle, BaloonText, Icon); }
/// <summary> /// 显示通知 /// </summary> /// <param name="text">通知正文</param> /// <param name="title">通知标题</param> /// <param name="Icon">通知图标</param> /// <param name="time">显示时间</param> public static void ShowTip(string text, string title = "录播姬", System.Windows.Forms.ToolTipIcon Icon = System.Windows.Forms.ToolTipIcon.Info, int time = 5000) { if (Properties.Settings.Default.IsNoticeShow) { NI.BalloonTipText = text; NI.BalloonTipTitle = title; NI.BalloonTipIcon = Icon; NI.ShowBalloonTip(time); } }
/// <summary> /// 显示提醒信息 /// </summary> /// <param name="timeout">提醒超时时间</param> /// <param name="title">提醒的标题</param> /// <param name="content">提醒的内容</param> /// <param name="tipIcon">提醒的图标</param> public static void ShowRemind(int timeout, string title, string content, System.Windows.Forms.ToolTipIcon tipIcon) { if (!main.Dispatcher.CheckAccess()) { main.Dispatcher.Invoke(new Action(() => { if (!main.notifyIcon.Visible) { main.notifyIcon.Visible = true; main.timerNotify.Change(10000, 10000); } main.notifyIcon.ShowBalloonTip(timeout, title, content, tipIcon); })); } else { if (!main.notifyIcon.Visible) { main.notifyIcon.Visible = true; main.timerNotify.Change(10000, 10000); } main.notifyIcon.ShowBalloonTip(timeout, title, content, tipIcon); } }
public void showBalloon(string title, string text, System.Windows.Forms.ToolTipIcon icon) { this.tray.ShowBalloonTip(1000, title, text, icon); }
//气泡框的显示 private void ShowBalloonTip(string content) { System.Windows.Forms.ToolTipIcon type = System.Windows.Forms.ToolTipIcon.Info; this.notifyIcon.ShowBalloonTip(1000, "通知", content, type); }
public void ShowBalloon(string title, string text, ToolTipIcon icon) { TasktrayIcon.BalloonTipIcon = icon; TasktrayIcon.BalloonTipText = text; TasktrayIcon.BalloonTipTitle = title; TasktrayIcon.ShowBalloonTip(10000); }
public static void ShowBalloonTip(string Message, string Caption = "消息", System.Windows.Forms.ToolTipIcon toolTipIcon = System.Windows.Forms.ToolTipIcon.Info, int TimeOut = 5) { AppSet.AppMainWindow.notifyIcon.ShowBalloonTip(TimeOut, Caption, Message, toolTipIcon); }
public void BalloonTipText(String text, System.Windows.Forms.ToolTipIcon icon) { ((TrayForm)owner).Tray.BalloonTipText = text; ((TrayForm)owner).Tray.BalloonTipIcon = icon; ((TrayForm)owner).Tray.ShowBalloonTip(10); }
public void ShowBalloonTip(int timeOut, string tipTitle, string tipText, ToolTipIcon tipIcon) { System.Windows.Forms.ToolTipIcon icon = (System.Windows.Forms.ToolTipIcon)tipIcon; notifyIcon.ShowBalloonTip(timeOut, tipTitle, tipText, icon); }
public void NotifyBalloon(string message, System.Windows.Forms.ToolTipIcon icon) { }
public void ShowBalloonTip(int timeout, string tipTitle, string tipText, System.Windows.Forms.ToolTipIcon tipIcon) { notifyIcon1.ShowBalloonTip(timeout, tipTitle, tipText, tipIcon); }
private void on_balloon_event(string[] args, System.Windows.Forms.ToolTipIcon tti) { this.showBalloon(args[0], args[1], tti); }
// Displays a balloon message public void ShowBalloon(string Title, string Message, System.Windows.Forms.ToolTipIcon Icon) { ToolbarIcon.ShowBalloonTip(MessageDuration, Title, Message, Icon); }
public static void ShowBallon(String message, EventHandler callback, System.Windows.Forms.ToolTipIcon icon) { notifyIcon.BalloonTipClicked += callback; notifyIcon.ShowBalloonTip(1200, AppName, message, icon); }