private void btnEdit_Click(object sender, EventArgs e) { if (listBox1.SelectedItem != null) { ServerInfo i = (ServerInfo)listBox1.SelectedItem; ServerDetailForm f = new ServerDetailForm(); f.CurrentServerInfo = i; if (f.ShowDialog() == DialogResult.OK) { RefreshListBox(); lock (Program._mainThreadMutex) { Monitor.PulseAll(Program._mainThreadMutex); } } } }
private void btnAdd_Click(object sender, EventArgs e) { ServerInfo i = new ServerInfo(); i._serverName = "<new>"; i._attempts = 3; ServerDetailForm f = new ServerDetailForm(); f.CurrentServerInfo = i; if (f.ShowDialog() == DialogResult.OK) { //we add it to our list lock (Program._mainThreadMutex) { ServerInfoList._list.Add(f.CurrentServerInfo); Monitor.PulseAll(Program._mainThreadMutex); } } RefreshListBox(); }