void AddFixupItem(string text, string setting, ToolStripMenuItem parent) { var item = new ToolStripMenuItem(text); item.Tag = setting; item.Click += delegate { GuiConfiguration.SetPracticeFixupSetting(setting, !GuiConfiguration.GetPracticeFixupSetting(setting)); }; parent.DropDownItems.Add(item); }
void OptionsItemDropDownOpening(object sender, EventArgs e) { swapItem.Checked = mode.Swap; foreach (ToolStripItem item in optionsItem.DropDownItems) { var menuItem = item as ToolStripMenuItem; if (menuItem != null && menuItem.Tag is string) { menuItem.Checked = GuiConfiguration.GetPracticeFixupSetting((string)menuItem.Tag); } } }