/// <summary> /// 设置提醒-自动设置 /// </summary> /// <param name="newDateTime"></param> private void SetRemind(DateTime newDateTime) { if (newDateTime <= DateTime.Now) { WindowMessage2 windowMessage = new WindowMessage2("朕想静静", "你退下吧"); windowMessage.Text = string.Format("陛下,陛下,你设置的提醒时间{0}已经过去了!备注是:{1}", newDateTime, Caption); windowMessage.Title = "陛下!陛下"; windowMessage.ShowDialog(); WindowSettings.RemindDateTime = null; return; } WindowSettings.RemindDateTime = newDateTime; WindowRemind windowRemind = new WindowRemind(Caption, newDateTime, _cancellationTokenSource); windowRemind.RemindDateTime = WindowSettings.RemindDateTime; windowRemind.RemindAction += RemindAction; windowRemind.CreateRemind(newDateTime); }
/// <summary> /// 设置提醒-手动设置 /// </summary> private void SetRemind() { string resutStr = RichTextBoxTool.StringFromRichTextBox(RichTextBox1); string[] strs = resutStr.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); if (strs.Length == 0) { resutStr = ""; } WindowRemind windowRemind = new WindowRemind(resutStr, WindowSettings.RemindDateTime, _cancellationTokenSource); windowRemind.RemindDateTime = WindowSettings.RemindDateTime; windowRemind.RemindAction += RemindAction; windowRemind.ShowDialog(); if (windowRemind.IsSave) { WindowSettings.RemindDateTime = windowRemind.RemindDateTime; } }