private void InitCheckedListBox(CheckedListBox checkedListBox1) { checkedListBox1.Items.Clear(); foreach (KeyValuePair <SortType, string> item in EnumDictionary <SortType> .Instance.Dictionary) { CheckedListBoxItem clbi = new CheckedListBoxItem(); clbi.Text = item.Value; clbi.Type = item.Key; checkedListBox1.Items.Add(clbi, false); } }
private List <SortInfo> GetLstSortType(CheckedListBox checkedListBox1) { List <SortInfo> lstSortCategory = new List <SortInfo>(); for (int i = 0; i < checkedListBox1.Items.Count; i++) { if (checkedListBox1.GetItemChecked(i) == false) { continue; } CheckedListBoxItem clbi = checkedListBox1.Items[i] as CheckedListBoxItem; SortInfo si = new SortInfo(); si.Type = clbi.Type; //si.Width lstSortCategory.Add(clbi.Type); } return(lstSortCategory); }