Exemplo n.º 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";
            }
        }
Exemplo n.º 2
0
 private async void Save_Click(object sender, RoutedEventArgs e)
 {
     if (Interval.Text != "" && Domain.Text != "" && Token.Text != "" &&
         SettingsController.SetSettings(Domain.Text, Token.Text, byte.Parse(Interval.Text)) &&
         await UpdaterController.StartUpdater())
     {
         ToggleUpdater.Content = "Stop";
         PopulateToolTip(byte.Parse(Interval.Text));
         DisableEdition();
     }
     else
     {
         MessageBox.Show("Complete all fields with valid data!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
         SettingsController.ResetSettings();
     }
 }
Exemplo n.º 3
0
        private async void SetupWindow()
        {
            Settings settings = SettingsController.GetSettings();

            if (settings.Domain != "" && settings.Token != "" && settings.Interval != 0)
            {
                Hide();
                PopulateFields(settings.Domain, settings.Token, settings.Interval);
                DisableEdition();
                PopulateToolTip(settings.Interval);
            }
            if (SettingsController.IsSettedOnStartup())
            {
                OnStartup.IsChecked = true;
            }
            else
            {
                OnStartup.IsChecked = false;
            }
            if (await UpdaterController.StartUpdater())
            {
                ToggleUpdater.Content = "Stop";
            }
        }