Ejemplo n.º 1
0
        private void butAddServer_Click(object sender, EventArgs e)
        {
            if (addNameInput.Text != "" && addIPInput.Text != "" && addPortInput.Text != "")
            {
                serverCheckList.Items.Add(addNameInput.Text);
                serverList.Items.Add(addNameInput.Text);

                // Save in Settings
                ServerObject serverObject = new ServerObject();
                serverObject.name = addNameInput.Text;
                serverObject.ip   = addIPInput.Text;
                int port;
                int.TryParse(addPortInput.Text, out port);
                serverObject.port = port;

                serverSettings.serverList.Add(serverObject);

                addNameInput.Clear();
                addIPInput.Clear();
                addPortInput.Clear();
            }
        }