private void RemindActionShowWindowMessage2() { WindowMessage2 windowMessage = new WindowMessage2("朕知道了", "等朕5分钟"); windowMessage.Text = "陛下,说好的让这个时间点提醒你干大事,快看,我做到了!你的备注是:" + Caption; windowMessage.Title = "陛下!陛下"; windowMessage.ShowDialog(); if (windowMessage.OperatingButton == "等朕5分钟") { SetRemind(DateTime.Now.AddMinutes(5)); } if (windowMessage.OperatingButton == "朕知道了") { WindowSettings.RemindDateTime = null; } }
/// <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); }