Esempio n. 1
0
 private void _buttonRefresh_Click(object sender, RoutedEventArgs e)
 {
     System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
     ViewModel.NewDatabaseViewModel newDatabaseViewModel = DataContext as ViewModel.NewDatabaseViewModel;
     newDatabaseViewModel.Refresh();
     System.Windows.Input.Mouse.OverrideCursor = null;
 }
Esempio n. 2
0
        private void _buttonBrowseSQLiteFolders_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
            if (dialog == null)
            {
                return;
            }

            ViewModel.NewDatabaseViewModel newDatabaseViewModel = DataContext as ViewModel.NewDatabaseViewModel;
            dialog.SelectedPath = newDatabaseViewModel.SQLite_Folder;
            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                newDatabaseViewModel.SQLite_Folder = dialog.SelectedPath;
            }
        }
Esempio n. 3
0
 private void _buttonOK_Click(object sender, RoutedEventArgs e)
 {
     ViewModel.NewDatabaseViewModel newDatabaseViewModel = DataContext as ViewModel.NewDatabaseViewModel;
     if (IEncryption != null)
     {
         newDatabaseViewModel.SQLServer_Password  = IEncryption.Encrypt(_passwordBoxSQLServer.Password);
         newDatabaseViewModel.PostgreSQL_Password = IEncryption.Encrypt(_passwordBoxPostgreSQL.Password);
         newDatabaseViewModel.MySQL_Password      = IEncryption.Encrypt(_passwordBoxMySQL.Password);
     }
     else
     {
         newDatabaseViewModel.SQLServer_Password  = _passwordBoxSQLServer.Password;
         newDatabaseViewModel.PostgreSQL_Password = _passwordBoxPostgreSQL.Password;
         newDatabaseViewModel.MySQL_Password      = _passwordBoxMySQL.Password;
     }
     DialogResult = true;
 }
Esempio n. 4
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     ViewModel.NewDatabaseViewModel newDatabaseViewModel = DataContext as ViewModel.NewDatabaseViewModel;
     if (newDatabaseViewModel.IDatabaseConfiguration.SavePassword)
     {
         if (IEncryption != null)
         {
             _passwordBoxSQLServer.Password  = IEncryption.Decrypt(newDatabaseViewModel.SQLServer_Password);
             _passwordBoxPostgreSQL.Password = IEncryption.Decrypt(newDatabaseViewModel.PostgreSQL_Password);
             _passwordBoxMySQL.Password      = IEncryption.Decrypt(newDatabaseViewModel.MySQL_Password);
         }
         else
         {
             _passwordBoxSQLServer.Password  = newDatabaseViewModel.SQLServer_Password;
             _passwordBoxPostgreSQL.Password = newDatabaseViewModel.PostgreSQL_Password;
             _passwordBoxMySQL.Password      = newDatabaseViewModel.MySQL_Password;
         }
     }
 }