コード例 #1
0
        private async void ToggleUpdater_Click(object sender, RoutedEventArgs e)
        {
            if (UpdaterController.IsRunning())
            {
                UpdaterController.StopUpdater();
                ToggleUpdater.Content = "Start";
            }
            else
            {
                await UpdaterController.StartUpdater();

                ToggleUpdater.Content = "Stop";
            }
        }
コード例 #2
0
 private void Wipe_Click(object sender, RoutedEventArgs e)
 {
     if (MessageBox.Show("Are you sure?", "Wipe settings",
                         MessageBoxButton.YesNo, MessageBoxImage.Question,
                         MessageBoxResult.No) == MessageBoxResult.Yes)
     {
         if (SettingsController.ResetSettings())
         {
             EnableEdition(true);
             PopulateFields("", "", 0);
             LoggerController.LogEvent("Wiped updater settings");
             UpdaterController.StopUpdater();
             LoggerController.LogEvent("Updater stopped");
             MessageBox.Show("Wipe succesful, updater stopped");
         }
         else
         {
             MessageBox.Show("Wipe failed", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
 }