/// <summary> /// 显示提醒窗口 /// </summary> private void ShowRemindWindow() { /* * 先判断程序是否禁止了提醒,再判断今天是否禁止了提醒,然后再进行推送 */ if (!Properties.Settings.Default.UnableRemind) { if (!Properties.Settings.Default.UnableRemindTheDay) { System.Windows.Application.Current.Dispatcher.Invoke(new Action(delegate { // 提醒窗口 string content = string.Format("你的流量已超过警告线!!"); RemindWindow rw = new RemindWindow("警告", content, RemindIcon.Warning); rw.Show(); })); } } }
/// <summary> /// 显示一般信息提醒窗口 /// </summary> /// <param name="title">窗口标题.</param> /// <param name="text">窗口内容</param> /// <param name="action">按钮结果.</param> /// <param name="isClickContentClose">是否点击内容关闭</param> /// <exception cref="System.NotImplementedException"></exception> public static void ShowNormalMsgWindow(string title, string text, Action action, bool isClickContentClose = false) { try { Application.Current.Dispatcher.BeginInvoke(new Action(() => { var window = new RemindWindow(title, text, action, isClickContentClose) { Owner = Application.Current.MainWindow }; window.Show(); })); } catch (Exception exx) { Logger.WriteLog(LogType.ERROR, exx.Message, exx); } }
/// <summary> /// 显示提醒窗口 /// </summary> private void ShowRemindWindow() { /* * 先判断程序是否禁止了提醒,再判断今天是否禁止了提醒,然后再进行推送 */ if (!Properties.Settings.Default.UnableRemind) { if (!Properties.Settings.Default.UnableRemindTheDay) { System.Windows.Application.Current.Dispatcher.Invoke(new Action(delegate { // 提醒窗口 string content = string.Format("你的流量已超过警告线!!"); RemindWindow rw = new RemindWindow("警告", content, RemindIcon.Warning); rw.Show(); })); } } }