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); }
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; }
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; }
private void Cancel(AddDatabaseView addDatabaseWindow) { addDatabaseWindow.DialogResult = false; }