Ejemplo n.º 1
0
        private void ComboBox_Ports_SelectedValueChanged(object sender, EventArgs e)
        {
            var port = ComboBox_Ports.SelectedItem?.ToString();

            if (port != String.Empty)
            {
                _communicationService.BindPort(port);
                _communicationService.TestConnectionAsync();

                Label_PortErrorMessage.Visible = false;
                Checkbox_Red.Enabled           = true;
                Checkbox_Green.Enabled         = true;
                Checkbox_Blue.Enabled          = true;
                Button_StartGamePreset.Enabled = true;

                if (ComboBox_Ports.Visible)
                {
                    HandlePortsComboBoxValueChanged();
                }
                else
                {
                    HandlePortsComboBoxInitialization();
                }
            }
            else
            {
                Label_PortErrorMessage.Visible = true;
            }
        }