private void Config_Changed(object sender, EventArgs e) { var oldOptions = sender as OptionsModel; if (oldOptions.General.IsTomatoMode != config.options.General.IsTomatoMode) { if (config.options.General.IsTomatoMode) { //启动番茄 Start(); //重置工作次数 workCount = 0; //重启计次 restartCount++; if (restartCount > 0) { //统计数据 tomatoDataToday.RestartCount++; } } else { //关闭番茄 Close(); if (worktoast != null) { worktoast.Hide(); } } } }
private void Worktoast_OnButtonClick(string name, Project1UIToast sender) { if (name == "准备就绪") { workTimer.Start(); } else { Close(); } sender.Hide(); }
/// <summary> /// 通知按钮被点击 /// </summary> /// <param name="name"></param> /// <param name="sender"></param> private void Toast_OnButtonClick(string name, Project1UIToast sender) { sender.Hide(); if (name == "好的") { SetPreAlertAction(PreAlertAction.Goto); } else { //跳过本次 SetPreAlertAction(PreAlertAction.Break); } }
private void Worktoast_OnButtonClick(string name, Project1UIToast sender) { if (name == $"{Application.Current.Resources["Lang_TomatoStart"]}") { workTimer.Start(); timerWatcher.Restart(); } else { Close(); } sender.Hide(); }
private void Worktoast_OnButtonClick(string name, Project1UIToast sender) { if (name == $"{Application.Current.Resources["Lang_TomatoStart"]}") { workTimer.Start(); timerWatcher.Restart(); tray.UpdateIcon("red-tomato-10"); icorefreshTimer.Interval = new TimeSpan(0, 0, config.options.Tomato.WorkMinutes * 60 / 10); icorefreshTimer.Start(); } else { Close(); } sender.Hide(); }
private void Toast_OnButtonClick(string name, Project1UIToast sender) { sender.Hide(); }