/// <summary> /// Called when a tool action has finished. Raises the ToolExecuted event. /// </summary> protected virtual void OnToolExecuted(ToolExecutedEventArgs eventArgs) { if (IsToolActionPending) throw new InvalidOperationException(string.Format("{0} tool actions pending.", pendingActions.Count)); if (ToolExecuted != null) ToolExecuted(this, eventArgs); }
private void Tool_ToolExecuted(object sender, ToolExecutedEventArgs e) { switch (e.EventType) { case ToolResult.Executed: if ((SelectedTool == (Tool)sender) && executeOnce) SelectDefaultTool(); break; case ToolResult.Canceled: if (!selecting) SelectDefaultTool(true); break; default: throw new NShapeUnsupportedValueException(e.EventType); } }
/// <summary> /// Initializes a new instance of <see cref="T:Dataweb.NShape.Advanced.Tool" />. /// </summary> protected Tool() { smallIcon = new Bitmap(16, 16); largeIcon = new Bitmap(32, 32); name = "Tool_" + this.GetHashCode().ToString(); ExecutedEventArgs = new ToolExecutedEventArgs(this, ToolResult.Executed); CancelledEventArgs = new ToolExecutedEventArgs(this, ToolResult.Canceled); }