private void OnSaveServer(ServerSetting s, bool removeServer) { //check if the server needs to be removed if (removeServer) { serversCollection.RemoveServer(s); } IRCConnection c = (IRCConnection)serverConnections[selectedServerID]; if (c != null) { if (c.IsConnected) { if (s.NickName != c.ServerSetting.CurrentNickName && s.TriedAltNick == false) _parent.ParseOutGoingCommand(c, "/nick " + s.NickName); //check for monitor list if (c.ServerSetting.MonitorSupport) { if (c.ServerSetting.BuddyListEnable) c.MonitorListCheck(); } } } SaveServerSettings(); f = null; }
private void OnNewServer(ServerSetting s) { s.ID = serversCollection.GetNextID(); s.IAL = new Hashtable(); serversCollection.AddServer(s); SaveServerSettings(); f = null; }
private void buttonEdit_Click(object sender, EventArgs e) { //open up the Server Editor //check if a server is selected or not if (Application.OpenForms["FormServers"] as FormServers != null) { Application.OpenForms["FormServers"].BringToFront(); return; } if (selectedServerID > 0) { f = new FormServers(GetServerSetting(selectedServerID)); f.SaveServer += new FormServers.SaveServerDelegate(OnSaveServer); f.NewServer += new FormServers.NewServerDelegate(OnNewServer); f.SaveDefaultServer += new FormServers.SaveDefaultServerDelegate(OnSaveDefaultServer); } else { f = new FormServers(); f.NewServer += new FormServers.NewServerDelegate(OnNewServer); f.SaveDefaultServer += new FormServers.SaveDefaultServerDelegate(OnSaveDefaultServer); } f.Show(this.Parent); }
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.Show(this.Parent); }
private void buttonAdd_Click(object sender, EventArgs e) { if (Application.OpenForms["FormServers"] as FormServers != null) { Application.OpenForms["FormServers"].BringToFront(); return; } FormServers f = new FormServers(); f.NewServer += new FormServers.NewServerDelegate(OnNewServer); f.SaveDefaultServer += new FormServers.SaveDefaultServerDelegate(OnSaveDefaultServer); f.Show(this.Parent); }