private void toolStripButtonClick(object sender, EventArgs e) { ToolStripButton toolStripButton = sender as ToolStripButton; ToolStripAction action = (ToolStripAction)toolStripButton.Tag; StripButtonClickHandler?.Invoke(sender, new ToolStripEventArgs(action)); RefreshButtonState(); }
public void SetMeasureTool(ToolStripAction action) { switch (action) { case ToolStripAction.Line: CommandLine(); break; case ToolStripAction.Rectangle: CommandRectangle(); break; case ToolStripAction.Ellipse: CommandEllipse(); break; case ToolStripAction.Polygon: CommandPolyLine(); break; case ToolStripAction.Laser: if (LaserType == LaserType.SaturnFixed) { CommandCircle(); } else if (LaserType == LaserType.SaturnActive) { CommandMultipleCircle(); } break; case ToolStripAction.Move: CommandMove(); break; default: CommandPointer(); break; } }
/// <summary> /// set cursor shape when click toolstrip button /// </summary> /// <param name="action"></param> /// <param name="isDoubleClick"></param> public void SetMeasureTool(ToolStripAction action, bool isDoubleClick) { SetMeasureTool(action); }
public ToolStripEventArgs(ToolStripAction action) { this.action = action; }