Hi Nagarij,
It works now. Thank you for help.
I have another two upgrade issues:
Issue 1:
the ZooomTool in v4.4.0.51 behaves differently from v3.3.0.0.
in V3.3.0.0, after activate ZoomTool, you move mouse on the diagram, you can continuestly keep left-clicking the diagram to zoom-in, or right-clicking the diagram to zoom out. but in V4.4.0.51, you can only click one time to zoom in/out. You can not keep clicking several time to zoom in/out. You can see this behavior in your syncfusion's sample OrgLayout as well.
Following is my code for zoomtool:
private void barItemZoomTool_Click(object sender, System.EventArgs e)
{
SetActiveTool("ZoomTool");
}
private void SetActiveTool(string toolName)
{
if (this.diagram.Controller.ActiveTool!=null)
this.diagram.Controller.ActiveTool.DeactivateTool();
this.diagram.Controller.ActivateTool(toolName);
this.diagram.Select(); // this make the the diagram to display symbol rectangle
}
Issue 2:
In your syncfusion's sample OrgLayout, the LinkTool currently does not clear the previous link lines. You can click LinkTool icon, then click on diagram's empty place several times to draw several dash lines,then click on SelectTool icon, then click the LinkTool icon again, the previous link lines are still on the diagram. I want to clear the previous link lines to start a new link drawing whenever I click the LinkTool.
I noticed the LinkTool has a built-in behavior to clear or terminate the link drawing by right-click on the diagram. I want the same function whenever I click the LinkTool icon. How can I do it by code?
Thanks,
Lan
>Hi Lan,
1. Thanks for your interest in Essential Diagram. we have made change in the diagram source code implementation mainly to fix the issues, to implement new features and to make diagram stable. As with the version v.4.4.0.51 ,Tool. Active is no longer valid. Please use tool.InAction property instead. Please refer to the following code snippet
Tool[] tools=this.diagram1.Controller.GetAllTools();
for (int i=0;i
{
Tool pTool=tools[i];
if (pTool.InAction) this.diagram1.Controller.DeactivateTool(pTool);
}
this.diagram1.ActivateTool("SelectTool");
2. If your intention is to insert a symbol using InsertSymbolTool, then please refer to following code snippet
MySymbol symbol=new MySymbol();
InsertSymbolTool tool=new InsertSymbolTool(this.diagram1.Controller,"InsertSymbolTool",typeof(MySymbol));
this.diagram1.Controller.RegisterTool(tool);
this.diagram1.Controller.ActivateTool(tool);
tool.Symbol=symbol;
this.diagram1.Controller.UpdateAllViews();
I have attached the sample that demonstrates this completely. Please refer to it and let me know if you have any problem in this version.
Thanks,
Nagaraj
InsertSymbol.zip