Example #1
0
        private void ChangePortButton_Click(object?sender, EventArgs e)
        {
            using var form = new ComPortSelectionForm
                  {
                      ComPortName = settings.ComPortName
                  };

            if (ShowDialogForm(form) == DialogResult.OK)
            {
                settings.ComPortName = form.ComPortName;
                UpdateControlsFromSettings();
                UpdateSessionManagerFromSettings();
            }
        }
        private void ChangePortButton_Click([CanBeNull] object sender, [NotNull] EventArgs e)
        {
            using (var form = new ComPortSelectionForm())
            {
                form.ComPortName = settings.ComPortName;

                if (form.ShowDialog() == DialogResult.OK)
                {
                    settings.ComPortName = form.ComPortName;
                    UpdateControlsFromSettings();
                    UpdateSessionManagerFromSettings();
                }
            }
        }