private void DispatchCommand(object sender, EventArgs e) { ButtonItemBase item = (ButtonItemBase)sender; CommandMapping cmd = (CommandMapping)item.Tag; Editor.DispatchCommand(cmd); }
private void SelectEditorType(ButtonItemBase menuButtonItem) { //Loop through all the menu bar items. for (int i = 0; i < menuBarItem1.Items.Count; i++) { //Uncheck all of them. menuBarItem1.Items[i].Checked = false; } //Loop through all the libraries for (int i = 0; i < menuButtonItem3.Items.Count; i++) { //Uncheck all items menuButtonItem3.Items[i].Checked = false; } //Check the provided MenuButtonItem menuButtonItem.Checked = true; }