public static void Activate(BaseTool tool, bool preventHistory = false) { if (tool == ActiveTool) return; if (DocumentManager.CurrentDocument == null) return; if (ActiveTool != null) Deactivate(preventHistory); ActiveTool = tool; if (ActiveTool != null) ActiveTool.ToolSelected(preventHistory); Mediator.Publish(EditorMediator.ToolSelected); }
private bool ShouldRelayEvent(BaseTool tool) { if (tool == null) return false; var usage = tool.Usage; return usage == BaseTool.ToolUsage.Both || (usage == BaseTool.ToolUsage.View2D && Viewport is Viewport2D) || (usage == BaseTool.ToolUsage.View3D && Viewport is Viewport3D); }
public void SelectTool(BaseTool t) { ToolManager.Activate(t); }