/// <summary> /// Creates a new tool for creating a templated shape. /// </summary> /// <param name="template">The template of the creation tool.</param> /// <param name="categoryTitle">Title of the toolbox category where the tool is inserted</param> public void CreateTemplateTool(Template template, string categoryTitle) { if (template == null) { throw new ArgumentNullException("template"); } if (FindTool(template) == null) { Tool tool = null; if (template.Shape is ILinearShape) { if (string.IsNullOrEmpty(categoryTitle)) { tool = new LinearShapeCreationTool(template); } else { tool = new LinearShapeCreationTool(template, categoryTitle); } } else { if (string.IsNullOrEmpty(categoryTitle)) { tool = new PlanarShapeCreationTool(template); } else { tool = new PlanarShapeCreationTool(template, categoryTitle); } } AddTool(tool); } }
private void InitTools() { toolsManager.Clear(); var tool1 = new BaseUIStuff.OverloadedTools.SelectionTool(); toolsManager.AddTool(tool1, new QuestsManipulatorWrapper(editingContext, tool1, flowView)); var tool2 = new LinearShapeCreationTool(new Template("Link", templates.GetLinkTemplate())); toolsManager.AddTool(tool2, new AddLinkWrapper(editingContext, tool2, flowView)); var tool3 = new PlanarShapeCreationTool(new Template("Quest", templates.GetQuestTemplate())); toolsManager.AddTool(tool3, new AddQuestWrapper(editingContext, tool3, flowView)); }