private DataPair <string> GetComboBoxData(ChoiceComboControl choiceComboControl) { return(new DataPair <string> { Key = choiceComboControl.choice_Combo.SelectedValue.ToString(), Value = choiceComboControl.onOff_CheckBox.Checked }); }
private void SetComboBoxData(DataPair <string> dataPair, ChoiceComboControl choiceComboControl, Dictionary <string, string> dictionary) { choiceComboControl.onOff_CheckBox.Checked = dataPair.Value; choiceComboControl.choice_Combo.SelectedItem = dictionary != null ? (object)dictionary.FirstOrDefault(x => x.Value == dataPair.Key) : dataPair.Key; }
private void GetDataFromChoiceComboBox(ChoiceComboControl choiceComboControl, DataPair <string> dataPair) { dataPair.Key = choiceComboControl.choice_Combo.SelectedValue.ToString(); dataPair.Value = choiceComboControl.onOff_CheckBox.Checked; }
private void SetChoiceControlDataSource(ChoiceComboControl choiceComboControl, Dictionary <string, string> dataSourceDictionary) { choiceComboControl.choice_Combo.DataSource = new BindingSource(dataSourceDictionary, null); choiceComboControl.choice_Combo.DisplayMember = "Key"; choiceComboControl.choice_Combo.ValueMember = "Value"; }
private void RemoveChoiceComboControlEventHandler(ChoiceComboControl choiceComboControl) { choiceComboControl.onOff_CheckBox.CheckedChanged -= OnControlComponentChanged; choiceComboControl.choice_Combo.SelectedIndexChanged -= OnControlComponentChanged; }
private void InitialiseChoiceComboControl(ChoiceComboControl choiceComboControl, DataPair <string> itemPair) { choiceComboControl.choice_Combo.SelectedItem = itemPair.Key; choiceComboControl.onOff_CheckBox.Checked = itemPair.Value; }