Пример #1
0
        private void Set_Click(object sender, EventArgs e)
        {
            string sNewHost  = HostNameBox.Text;
            string sNewPort  = PortName.Text;
            Int32  sPort_num = 0;

            ConnectingLabel.Text = "Connecting...";
            Application.DoEvents();
            try {
                sPort_num = Convert.ToInt32(sNewPort);
            }
            catch (FormatException e1)
            {
                sNewPort  = "0";
                sPort_num = 0;
            }

            ZumConsole.Properties.Settings.Default.Hostname = HostNameBox.Text;
            ZumConsole.Properties.Settings.Default.Port     = sPort_num;
            ZumConsole.Properties.Settings.Default.Save();

            /******Raise the event when OK button is pressed**********/
            NetUpdateEventArgs args = new NetUpdateEventArgs(sNewHost, sNewPort);

            NetParametersUpdated(this, args);
            /****************************************************/

            /******Raise the event of Form disposal **********/
            ConnFormCloseEventArgs args1 = new ConnFormCloseEventArgs(0x01);

            ConnFormClosing(this, args1);
            /****************************************************/

            this.Dispose();
        }
Пример #2
0
        private void Form2_FormClosing(object sender, FormClosingEventArgs e)
        {
            ZumConsole.Properties.Settings.Default.Hostname = HostNameBox.Text;
            ZumConsole.Properties.Settings.Default.Port     = PortNumber;
            ZumConsole.Properties.Settings.Default.Save();

            /******Raise the event when Form is closed **********/
            ConnFormCloseEventArgs args1 = new ConnFormCloseEventArgs(0x01);

            ConnFormClosing(this, args1);
            /****************************************************/
        }
Пример #3
0
 private void ConnFormClosed(object sender, ConnFormCloseEventArgs e)
 {
     ConnSettings.Enabled = true;
 }