private void CategorySelector_Load(object sender, EventArgs e) { if (currentUserID != -1) { Dictionary <int, string> categoryDictionary = screenShareManager.GetAllLessons(); List <ComboBoxItem> comboBoxItems = new List <ComboBoxItem>(); categoryDictionary.Add(0, "Random"); foreach (var dict in categoryDictionary) { ComboBoxItem item = new ComboBoxItem(); item.Text = dict.Value; item.Value = dict.Key; comboBoxItems.Add(item); } categoryComboBox.DataSource = comboBoxItems; } else { labelError1.Visible = true; labelError2.Visible = true; btnSubmitCategory.Enabled = false; categoryComboBox.Enabled = false; } }
public Dictionary <int, string> GetAllLessons() { return(screenShareComplexManager.GetAllLessons()); }