private void SelectIconsForm_Load(object sender, EventArgs e) { var powerschemes = _powerProcessor.GetAllPowerSchemes().ToList(); var activeScheme = powerschemes.Single(j => j.IsActive); comboBox1.Items.AddRange(powerschemes.Select(i => (object)new ComboboxItem { Text = i.Name, Value = i.Name }).ToArray()); comboBox1.SelectedIndex = comboBox1.FindStringExact(activeScheme.Name); }
private IEnumerable <ToolStripItem> CreateItems() { var items = new List <ToolStripItem>(); items.AddRange(GetPowerSchemeItems(_powerProcessor.GetAllPowerSchemes())); items.Add(GetAutomaticModeItem()); items.Add(new ToolStripSeparator()); items.Add(GetOptionsItem()); items.Add(GetIconSectionItem()); items.Add(GetExitItem()); return(items); }