示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
 public void SelectTool(BaseTool t)
 {
     ToolManager.Activate(t);
 }