public CommandBinding(ToolStripDropDown dropDown, AudioToolStripMenuItem item, Command command) { _dropDown = dropDown; _item = item; _command = command; RegisterEvents(); UpdateCommand(); }
private void OnItemMouseUp(object sender, MouseEventArgs e) { // TODO: This should be WM_CONTEXTMENU if (e.Button == MouseButtons.Right) { AudioToolStripMenuItem item = (AudioToolStripMenuItem)sender; item.DropDown.BindCommand(_commandManager, CommandId.SetAsDefaultMultimediaDevice, item.GetArgument()); item.DropDown.BindCommand(_commandManager, CommandId.SetAsDefaultCommunicationDevice, item.GetArgument()); item.DropDownClosed += OnDropDownClosed; item.DropDown.Capture = true; item.ShowDropDown(e.Location); } }