private void ShowConnectionBox() { using (ConnectionBox form = new ConnectionBox()) { if (form.ShowDialog(this) == DialogResult.OK) { Host host = form.GetHost(); Host lastHost = Settings.Hosts[0]; bool isConnectionChanged = !string.Equals(host.Server, (Settings.ActiveHost ?? new Host()).Server, StringComparison.CurrentCultureIgnoreCase) && !string.Equals(host.Server, (lastHost ?? new Host()).Server, StringComparison.CurrentCultureIgnoreCase); Settings.ActiveHost = host; Text = host.Server.ToUpper(); buttonDatabases.Enabled = true; buttonRefreshIndex.Enabled = host.Databases.Count > 0; labelServerInfo.Visibility = BarItemVisibility.Always; labelServerInfo.Caption = host.ServerInfo.ToString(); Output.Current.Add($"Host: {host.Server}"); Output.Current.Add($"Server: {host.ServerInfo}"); ShowDatabaseBox(isConnectionChanged); } } }
private void ShowConnectionBox() { using (ConnectionBox form = new ConnectionBox()) { DialogResult dr = form.ShowDialog(this); if (dr == DialogResult.OK) { UpdateActiveHost(form.GetHost()); } } }