コード例 #1
0
        private void RunAuthButton_Click(object sender, RoutedEventArgs e)
        {
            App.Logger.Trace("StartWindow.RunAuthButton");
            AuthenticatorSettingsWindow settingsWindow = new AuthenticatorSettingsWindow();

            if (settingsWindow.ShowDialog() == true)
            {
                try
                {
                    Core.Authenticator  authenticator = new Core.Authenticator(settingsWindow.AccountFilePath, settingsWindow.Password);
                    AuthenticatorWindow window        = new AuthenticatorWindow(authenticator);
                    window.Show();
                    Close();
                }
                catch (Exception ex)
                {
                    App.Logger.Error($"AuthenticatorWindow.RunAuthButton Error: {ex.Message}");
                }
            }
        }
コード例 #2
0
 private void App_Startup(object sender, StartupEventArgs e)
 {
     Logger.Info("------------------------------------");
     Logger.Info("\tApp Start");
     Logger.Info("------------------------------------");
     try
     {
         Settings settings = GetSettings();
         if (settings != null)
         {
             Core.Authenticator authenticator = new Core.Authenticator(settings);
             new AuthenticatorWindow(authenticator).Show();
         }
         else
         {
             new StartWindow().Show();
         }
     }
     catch (Exception ex)
     {
         Logger.Error($"App_Startup Error: {ex.Message}");
         new StartWindow().Show();
     }
 }