private void editToolStripMenuItem_Click(object sender, EventArgs e) { if (selectedServerID > 0) { f = new FormServers(GetServerSetting(selectedServerID)); f.SaveServer += new FormServers.SaveServerDelegate(OnSaveServer); f.SaveDefaultServer += new FormServers.SaveDefaultServerDelegate(OnSaveDefaultServer); } else { f = new FormServers(); f.NewServer += new FormServers.NewServerDelegate(OnNewServer); f.SaveDefaultServer += new FormServers.SaveDefaultServerDelegate(OnSaveDefaultServer); } f.ShowDialog(this.Parent); }
private void buttonEdit_Click(object sender, EventArgs e) { //System.Diagnostics.Debug.WriteLine(selectedServerID); //open up the Server Editor //check if a server is selected or not if (selectedServerID > 0) { f = new FormServers(GetServerSetting(selectedServerID)); f.SaveServer += new FormServers.SaveServerDelegate(OnSaveServer); f.SaveDefaultServer += new FormServers.SaveDefaultServerDelegate(OnSaveDefaultServer); } else { f = new FormServers(); f.NewServer += new FormServers.NewServerDelegate(OnNewServer); f.SaveDefaultServer += new FormServers.SaveDefaultServerDelegate(OnSaveDefaultServer); } f.ShowDialog(this.Parent); }
private void OnSaveServer(ServerSetting s, bool removeServer) { //check if the server needs to be removed if (removeServer) { serversCollection.RemoveServer(s); } SaveServerSettings(); f = null; }
private void buttonAdd_Click(object sender, EventArgs e) { FormServers f = new FormServers(); f.NewServer += new FormServers.NewServerDelegate(OnNewServer); f.SaveDefaultServer += new FormServers.SaveDefaultServerDelegate(OnSaveDefaultServer); f.ShowDialog(this.Parent); }
private void OnNewServer(ServerSetting s) { s.ID = serversCollection.GetNextID(); s.IAL = new Hashtable(); serversCollection.AddServer(s); SaveServerSettings(); f = null; }