private void StopApp(object sender, RoutedEventArgs e) { if (isRunning) { task.ShutDown(); this.startMenu.IsEnabled = true; this.stopMenu.IsEnabled = false; isRunning = false; this.log.Text += "定时任务停止成功\n"; } }