Example #1
0
        private void loadWithCreds()
        {
            var creds = CredsFile.readConfig();

            txtUsername.Text       = creds.username;
            txtApikey.Text         = creds.apikey;
            MainWindow.credentials = creds;
        }
Example #2
0
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         CredsFile.writeConfig(txtUsername.Text, txtApikey.Text);
     }
     catch (Exception ex)
     {
         MessageBox.Show("There was a problem saving the configuration." + ex.Message,
                         "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     this.Close();
 }
Example #3
0
        private static void load_creds()
        {
            try
            {
                creds = CredsFile.readConfig();
            }
            catch (Exception)
            {
                creds = new Credentials();
            }

            if (String.IsNullOrEmpty(creds.apikey) || String.IsNullOrEmpty(creds.username))
            {
                CredsWindow cw = new CredsWindow();
                cw.Show();
                MainWindow.ErrorMessage("Credentials are required.", "Credentials Required");
            }
        }