public LogView() { this.InitializeComponent(); ComboBoxItem[] ComboBoxItems = new ComboBoxItem[this.LogLevelSelectComboBox.Items.Count]; this.LogLevelSelectComboBox.Items.CopyTo(ComboBoxItems, 0); this.LogLevelColors = ComboBoxItems.ToDictionary((ComboBoxItem x) => (LogLevel)Convert.ToInt32(x.Tag, CultureInfo.CurrentCulture), (ComboBoxItem y) => y.Foreground); }
public LogView() { InitializeComponent(); var ComboBoxItems = new ComboBoxItem[LogLevelSelectComboBox.Items.Count]; LogLevelSelectComboBox.Items.CopyTo(ComboBoxItems, 0); LogLevelColors = ComboBoxItems.ToDictionary(x => ((LogLevel)Convert.ToInt32(x.Tag)), y => y.Foreground); }