public void Select(MetroToolStripButton item) { // Get command from control var command = item.Tag as CommandObject; if (command == null) { return; } var action = _actionList[item]; if (action != null) { action(command); } // Toggle proccessing if (_lastItem != null) { _lastItem.Checked = false; } _lastItem = item; if (_lastItem != null) { _lastItem.Checked = true; } }
public void Connect(MetroToolStripButton item, DrawPadAction action) { item.MouseDown += Item_MouseDown; if (item.IsDropDownButton) { ((MetroToolStripDropDownButton)item).DropDownItemClicked += Item_DropDownItemClicked; } _actionList.Add(item, action); }
public void Connect(MetroToolStripButton item, CommandObject command, DrawPadAction action) { item.Tag = command; Connect(item, action); }