Example #1
0
        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;
            }
        }
Example #2
0
 public void Connect(MetroToolStripButton item, DrawPadAction action)
 {
     item.MouseDown += Item_MouseDown;
     if (item.IsDropDownButton)
     {
         ((MetroToolStripDropDownButton)item).DropDownItemClicked += Item_DropDownItemClicked;
     }
     _actionList.Add(item, action);
 }
Example #3
0
 public void Connect(MetroToolStripButton item, CommandObject command, DrawPadAction action)
 {
     item.Tag = command;
     Connect(item, action);
 }