Exemple #1
0
        public static void CreateBindSource(DicOper dic, string selectedValue, ComboBox comboBox)
        {
            BindingSource bs = new BindingSource();

            bs.DataSource = dic.Dic;

            comboBox.DataSource    = bs;
            comboBox.DisplayMember = "Value";
            comboBox.ValueMember   = "Key";
            if (!string.IsNullOrWhiteSpace(selectedValue))
            {
                comboBox.SelectedValue = selectedValue;
            }
        }
Exemple #2
0
 public static string GetDicValue(DicOper dic, string keyContent)
 {
     return(dic.GetDicValueByKey(keyContent));
 }