We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

version upgrade issue

Upgrade from V3.3.0.0 to 4.4.0.51, got these two compile errors related to method or property dropped in the new versiion.

Error 1:
C:\PMA\STN.PMA.UL\frmDecisionTree.cs(2316): 'Syncfusion.Windows.Forms.Diagram.Tool' does not contain a definition for 'Active'

private void barItemSelectTool_Click(object sender, System.EventArgs e)
{
// deactive all tools
Tool[] tools=this.diagram.Controller.GetAllTools();
for (int i=0;i {
Tool pTool=tools[i];
if (pTool.Active) this.diagram.Controller.DeactivateTool(pTool);
}
this.diagram.ActivateTool("SelectTool");
this.diagram.Cursor=Cursors.Default;

}

I've tried to use:
if (pTool.InAction) this.diagram.Controller.DeactivateTool(pTool);


Error 2:
C:\PMA\STN.PMA.UL\frmDecisionTree.cs(2277): The best overloaded method match for 'Syncfusion.Windows.Forms.Diagram.InsertSymbolTool.InsertSymbolTool(Syncfusion.Windows.Forms.Diagram.DiagramController, string)' has some invalid arguments

private void RegisterCustomTools()
{
//V3.2.1.0

this.diagram.Model.ChildrenChangeComplete+=new NodeCollectionEventHandler(this.diagram_Model_ChildrenChangeComplete);
this.diagram.Controller.RegisterTool(new InsertSymbolTool("InsertCondition", typeof(clsConditionSymbol)));
this.diagram.Controller.RegisterTool(new InsertSymbolTool("InsertResult", typeof(clsAlternativeSymbol)));

this.insSymbolTool = new InsertSymbolTool("InsertSymbolLinkSymbol", typeof(clsConditionSymbol));
this.diagram.Controller.RegisterTool(this.insSymbolTool);

// Attach link object factory to the link tool
Tool linkTool = this.diagram.Controller.GetTool("LinkTool");
if (linkTool != null && linkTool.GetType() == typeof(LinkTool))
{
#if false
((LinkTool)linkTool).LinkFactory = new LinkFactory(this.CreateOrthogonalLink);
#else
((LinkTool)linkTool).LinkFactory = new LinkFactory(this.CreateLink);
#endif
}

I've tried to use:
this.diagram.Controller.RegisterTool(new InsertSymbolTool(this.diagram.Controller,"InsertCondition", typeof(clsConditionSymbol)));

But they don't work well.
What new methods I should use?
Thanks,

Lan

8 Replies

J. J.Nagarajan Syncfusion Team January 5, 2007 12:13 AM UTC

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



AD Administrator Syncfusion Team January 5, 2007 05:10 PM UTC

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



J. J.Nagarajan Syncfusion Team January 5, 2007 10:38 PM UTC

Hi Lan,

1. Thanks for the update. If your intention is to activate Zoom-in and Zoom-out functionality by continuously clicking the Left and Right mouse buttons then please refer to the following code snippet

Tool tool=this.diagram1.Controller.GetTool("ZoomTool");
tool.SingleActionTool=false;
this.diagram1.Controller.ActivateTool(tool);

Please refer to the attached sample and let me know if you have any questions.

ZoomTool.zip


2. You can avoid the link memory by unregistering the LinkTools under Diagram Controller's ToolDeactivate Event and registering them when the tool is chosen.

//UnRegistering Linkmemory
private void diagram1_Controller_ToolDeactivate(object sender, DiagramController.ToolEventArgs evtArgs)
{
if (evtArgs.Tool.Name == "LinkTool" )
{
this.diagram1.Controller.UnRegisterTool(evtArgs.Tool);
}
if (evtArgs.Tool.Name == "OrthogonalLinkTool")
{
this.diagram1.Controller.UnRegisterTool(evtArgs.Tool);
}
}

//Registering Link
private void barItemLink_Click(object sender, EventArgs e)
{
LinkTool linkTool = new LinkTool (this.diagram1.Controller);
this.diagram1.Controller.RegisterTool(linkTool);
this.diagram1.Controller.ActivateTool("LinkTool");
}

I have attached the sample that demonstrates this completely. Please refer to it and let me know if you have any questions.

LinkToolIssue.zip


Thanks,
Nagaraj


AD Administrator Syncfusion Team January 8, 2007 05:05 PM UTC

Hello,
One more question, in v4.4.0.51, the click-drag rectangle select tool now behaves differently. There are two rectangle-borders appear. You can see this behavior in your sample InsertSymbol_6d9cba59.zip as well.
Add some symbols in diagram, click on the diagram, drag a rectangle to select several symboles. you'll see two dash-line rectangle borders. How to fix it?
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



J. J.Nagarajan Syncfusion Team January 8, 2007 11:15 PM UTC

Hi Lan,

Sorry for the inconvenience caused. This is known issue in v.4.4.0.51. I have already notified this issue to our developer. I will get back to you with more details once this issue has been resolved.

Defect #2846 - Problem with Diagram symbol selection

Please let me know if you have any questions.

Thanks,
Nagaraj


AD Administrator Syncfusion Team January 12, 2007 07:36 PM UTC

Hi,
Thanks for help.

I have another issue related to upgrade diagram from v3.3.0.0 to v4.4.0.51. This issue has no compile error but related to deployment.
when application(upgraded to v4.4.0.51) open the diagram which was created in v3.3.0.0 and stored in blob table field. It displays error:
"Cannot find the assembly Syncfusion.Scripting.Base."

I added "Syncfusion.Scripting.Base" and "Syncfusion.Scripting.Windows" into the project reference and recompiled my setup project that auto-detected and included them for deployment. Now the application displays diagram properly. I guess this solved the issue.

I am just curious why I need to deploy these two DLLs even my code and compiler havn't indicated to add reference to them? Are they just for loading the old diagrams created in previous version?

Thanks,

Lan






J. J.Nagarajan Syncfusion Team January 17, 2007 08:54 PM UTC

Hi Lan,

For some reasons I was not able to visualize the condition that you have mentioned here. Could you please provide us some more details and provide us diagram file that you have created in v.3.3. I would be helpful to resolve this issue at the earliest.

Thanks,
Nagaraj


AD Administrator Syncfusion Team January 18, 2007 01:59 PM UTC

Hi Nagaraj,
Thank you for looking my question. This question is just for my knowledge. my product is not affected by this question or issue. So you can close it now.
Thank you again for help. Have a great day!


Lan


Loader.
Live Chat Icon For mobile
Up arrow icon