Ejemplo n.º 1
0
        private AddDatabaseView GetAddDatabaseView()
        {
            AddDatabaseView retVal = null;

            // create in ui dispatcher so this method can also be called from an task
            this.UIDispatcher.Invoke(() => retVal = new AddDatabaseView(this.connectionManager, this.fileSystemAccess, this.processManager, this.differenceCreator, this.sQLFileTester));

            return(retVal);
        }
Ejemplo n.º 2
0
        private void ShowAddDatabaseDialog()
        {
            WindowEffect = AppInfo.WindowBlurEffect;
            var databaseView = new AddDatabaseView();

            if (databaseView.ShowDialog() == true)
            {
                MainWindowViewModel.DatabasesSource.Add(new Database(databaseView.ViewModel.DatabaseName, MainWindowViewModel));
            }
            WindowEffect = null;
        }
Ejemplo n.º 3
0
        private void AddDatabase(AddDatabaseView addDatabaseWindow)
        {
            if (string.IsNullOrWhiteSpace(DatabaseName))
            {
                Messages.InfoMessage($"Database name cannot be null or whitespace.", AppInfo.BaseAppInfo);
                return;
            }

            if (!new DirectoryInfo($"\\\\{DatabaseName}\\c$").Exists&& Messages.ConfirmAction($"The database \"{DatabaseName}\" could not be found.{Environment.NewLine}Do you still want to add the database?", AppInfo.BaseAppInfo) == MessageBoxResult.No)
            {
                return;
            }

            DatabaseService.AddDatabaseNameToSettingsFileAsync(DatabaseName);
            addDatabaseWindow.DialogResult = true;
        }
Ejemplo n.º 4
0
 private void Cancel(AddDatabaseView addDatabaseWindow)
 {
     addDatabaseWindow.DialogResult = false;
 }