Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 private void OnSaveServer(ServerSetting s, bool removeServer)
 {
     //check if the server needs to be removed
     if (removeServer)
     {
         serversCollection.RemoveServer(s);
     }
     SaveServerSettings();
     f = null;
 }
Пример #4
0
 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);
 }
Пример #5
0
 private void OnNewServer(ServerSetting s)
 {
     s.ID = serversCollection.GetNextID();
     s.IAL = new Hashtable();
     serversCollection.AddServer(s);
     SaveServerSettings();
     f = null;
 }