private void UpdateServers() { foreach (SCConnectionStringBuilder serverSettting in ServerConfiguration.GetAllServerConfiguration()) { var serverName = serverSettting.GetDisplayName(); var displayServer = new DisplayServer(serverName); displayServer.ServerSetting = serverSettting; cboRecentServers.Items.Add(displayServer); _servers.Add(serverName, serverSettting); } if (cboRecentServers.Items.Count > 0) { cboRecentServers.SelectedIndex = 0; cboRecentServers.Text = cboRecentServers.SelectedText; } }
private void GetRecentServers() { tsmRecentServers.DropDownItems.Clear(); tssServer.DropDownItems.Clear(); tssServer.Alignment = ToolStripItemAlignment.Right; foreach (SCConnectionStringBuilder serverSettting in ServerConfiguration.GetAllServerConfiguration()) { ToolStripMenuItem item = new ToolStripMenuItem(serverSettting.GetDisplayName()); item.Tag = serverSettting; tsmRecentServers.DropDownItems.Add(item); ToolStripMenuItem item2 = new ToolStripMenuItem(serverSettting.GetDisplayName()); item2.Tag = serverSettting; tssServer.DropDownItems.Add(item2); item2.Click += new EventHandler(recentServer_Click); item.Click += new EventHandler(recentServer_Click); } }