private void btnInput_Click(object sender, EventArgs e) { FormComSelect comDlg = new FormComSelect(); comDlg.IsInputPort = true; DialogResult ret = comDlg.ShowDialog(); if (DialogResult.OK == ret) { IPort newPort = comDlg.GetPort(); if (newPort != null) { if (inPort != null) { inPort.Dispose(); } inPort = newPort; textBoxInputPort.Text = comDlg.GetDisplayString(); inPort.Read += new PortReadEvent(inPort_Read); } } }
private void btnOutput_Click(object sender, EventArgs e) { FormComSelect comDlg = new FormComSelect(); comDlg.IsInputPort = false; DialogResult ret = comDlg.ShowDialog(); if (DialogResult.OK == ret) { IPort newPort = comDlg.GetPort(); if (newPort != null) { if (outPort != null) outPort.Dispose(); outPort = newPort; textBoxOutputPort.Text = comDlg.GetDisplayString(); } } }
private void btnInput_Click(object sender, EventArgs e) { FormComSelect comDlg = new FormComSelect(); comDlg.IsInputPort = true; DialogResult ret = comDlg.ShowDialog(); if(DialogResult.OK == ret) { IPort newPort = comDlg.GetPort(); if(newPort != null) { if (inPort != null) inPort.Dispose(); inPort = newPort; textBoxInputPort.Text = comDlg.GetDisplayString(); inPort.Read += new PortReadEvent(inPort_Read); } } }
private void btnOutput_Click(object sender, EventArgs e) { FormComSelect comDlg = new FormComSelect(); comDlg.IsInputPort = false; DialogResult ret = comDlg.ShowDialog(); if (DialogResult.OK == ret) { IPort newPort = comDlg.GetPort(); if (newPort != null) { if (outPort != null) { outPort.Dispose(); } outPort = newPort; textBoxOutputPort.Text = comDlg.GetDisplayString(); } } }