Exemplo n.º 1
0
 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;
        }
Exemplo n.º 3
0
 private void GetDataFromChoiceComboBox(ChoiceComboControl choiceComboControl, DataPair <string> dataPair)
 {
     dataPair.Key   = choiceComboControl.choice_Combo.SelectedValue.ToString();
     dataPair.Value = choiceComboControl.onOff_CheckBox.Checked;
 }
Exemplo n.º 4
0
 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";
 }
Exemplo n.º 5
0
 private void RemoveChoiceComboControlEventHandler(ChoiceComboControl choiceComboControl)
 {
     choiceComboControl.onOff_CheckBox.CheckedChanged     -= OnControlComponentChanged;
     choiceComboControl.choice_Combo.SelectedIndexChanged -= OnControlComponentChanged;
 }
Exemplo n.º 6
0
 private void InitialiseChoiceComboControl(ChoiceComboControl choiceComboControl, DataPair <string> itemPair)
 {
     choiceComboControl.choice_Combo.SelectedItem = itemPair.Key;
     choiceComboControl.onOff_CheckBox.Checked    = itemPair.Value;
 }