Пример #1
0
 private void btnConfigureComPort_Click(object sender, EventArgs e)
 {
     CloseComPort();
     try
     {
         comPortConfigForm.Show();
     }
     catch (Exception)
     {
         comPortConfigForm = new ComPortConfigForm(this);
         comPortConfigForm.Show();
     }
     finally
     {
         comPortConfigForm.SetComboBoxes(this.comPortName, this.baudRate, this.parity, this.dataBits, this.stopBits);
     }
 }
        private void btnConfigureComPort_Click(object sender, EventArgs e)
        {
            if (comPortConfigForm != null && comPortConfigForm.Visible)
            {
                return;
            }

            CloseComPort();
            availableComPortNames = FindAvailableComPorts();

            try
            {
                comPortConfigForm.SetComboBoxes(this.availableComPortNames, this.comPortName, this.baudRate, this.parity, this.dataBits, this.stopBits, this.handshake, this.rtsEnable, this.dtrEnable);
                comPortConfigForm.ShowDialog();
            }
            catch (Exception)
            {
                comPortConfigForm = new ComPortConfigForm(this);
                comPortConfigForm.SetComboBoxes(this.availableComPortNames, this.comPortName, this.baudRate, this.parity, this.dataBits, this.stopBits, this.handshake, this.rtsEnable, this.dtrEnable);
                comPortConfigForm.ShowDialog();
            }
        }
        private void btnConfigureComPort_Click(object sender, EventArgs e)
        {
            if (comPortConfigForm != null && comPortConfigForm.Visible)
                    return;

               CloseComPort();
               availableComPortNames = FindAvailableComPorts();

               try
               {
                    comPortConfigForm.SetComboBoxes(this.availableComPortNames, this.comPortName, this.baudRate, this.parity, this.dataBits, this.stopBits, this.handshake, this.rtsEnable, this.dtrEnable);
                    comPortConfigForm.ShowDialog();
               }
               catch (Exception)
               {
                    comPortConfigForm = new ComPortConfigForm(this);
                    comPortConfigForm.SetComboBoxes(this.availableComPortNames, this.comPortName, this.baudRate, this.parity, this.dataBits, this.stopBits, this.handshake, this.rtsEnable, this.dtrEnable);
                    comPortConfigForm.ShowDialog();
               }
        }
 private void btnConfigureComPort_Click(object sender, EventArgs e)
 {
     CloseComPort();
        try
        {
             comPortConfigForm.Show();
        }
        catch (Exception)
        {
             comPortConfigForm = new ComPortConfigForm(this);
             comPortConfigForm.Show();
        }
        finally
        {
             comPortConfigForm.SetComboBoxes(this.comPortName, this.baudRate, this.parity, this.dataBits, this.stopBits);
        }
 }