private void ShowDatabaseBox() { using (DatabaseBox form = new DatabaseBox()) { DialogResult dr = form.ShowDialog(this); if (dr == DialogResult.OK) { Settings.ActiveHost.Databases = form.GetDatabases(); RefreshIndexes(); } else { labelDatabase.Caption = Settings.ActiveHost.Databases.Count.ToString(); } } }
private void ShowDatabaseBox(bool isConnectionChanged) { using (DatabaseBox form = new DatabaseBox()) { if (form.ShowDialog(this) == DialogResult.OK) { List <string> dbs = form.GetDatabases(); bool isDatabaseSelectionEqual = Settings.ActiveHost.Databases.OrderBy(t => t).SequenceEqual(dbs.OrderBy(t => t)); Settings.ActiveHost.Databases = dbs; if (Settings.Options.ShowSettingsWhenConnectionChanged && (!isDatabaseSelectionEqual || isConnectionChanged)) { ShowSettingsBox(); } RefreshIndexes(); } else { labelDatabases.Caption = Settings.ActiveHost.Databases.Count.ToString(); labelDatabases.Visibility = BarItemVisibility.Always; } } }