Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Anchor pattern changes while loading (Read 9222 times)
SL_developer
YaBB Newbies
*
Offline


coding rocks

Posts: 43
Joined: Jul 26th, 2011
Anchor pattern changes while loading
Aug 18th, 2011 at 4:38am
Print Post  
Hi,
while loading the saved diagram , anchor behavior change to normal position.
As I applied anchor pattern also but its not showing the same while loading it from file.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Anchor pattern changes while loading
Reply #1 - Aug 18th, 2011 at 5:29am
Print Post  
Hi,

What do you mean by "change to normal position"? If you are using custom AnchorPattern objects and they are not loaded, make sure you create them with the constructor that takes an id argument. AnchorPatterns are saved only by id, and you should have them already defined when  loading the diagram file next time.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
SL_developer
YaBB Newbies
*
Offline


coding rocks

Posts: 43
Joined: Jul 26th, 2011
Re: Anchor pattern changes while loading
Reply #2 - Aug 18th, 2011 at 1:11pm
Print Post  
Hi,
"Change to normal position" means Link Cascading style is not shown.

Code
Select All
 diagram.LinkStyle = LinkStyle.Cascading;
 diagram.LinkSegments = 3;
 


like this I am creating linkstyle, and
loading diagram in this way :
Code
Select All
 diagram.LoadFromString(xml);
 



Now tell me what I need to do?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Anchor pattern changes while loading
Reply #3 - Aug 18th, 2011 at 2:56pm
Print Post  
Do you mean that loading a file changes the LinkStyle property to Polyline? LinkStyle is saved too when you call SaveToXml, so if you load an older file created before you started using Cascading links, LinkStyle will revert to Polyline. In such case, you will have to reset the property to Cascading after calling LoadFromXml.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
SL_developer
YaBB Newbies
*
Offline


coding rocks

Posts: 43
Joined: Jul 26th, 2011
Re: Anchor pattern changes while loading
Reply #4 - Sep 7th, 2011 at 9:54am
Print Post  
Hi
How to reset the property to Cascading after calling LoadFromXml ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Anchor pattern changes while loading
Reply #5 - Sep 7th, 2011 at 9:59am
Print Post  
Like this:

Code
Select All
diagram.LoadFromString(xml);
diagram.LinkStyle = LinkStyle.Cascading; 



Diagram.LinkStyle is a default value for new links. If you need to change the style of existing links after loading a file, you will have to loop over them:

Code
Select All
diagram.LoadFromString(xml);
diagram.LinkStyle = LinkStyle.Cascading;
foreach (DiagramLink link in diagram.Links)
	link.Style = LinkStyle.Cascading; 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
SL_developer
YaBB Newbies
*
Offline


coding rocks

Posts: 43
Joined: Jul 26th, 2011
Re: Anchor pattern changes while loading
Reply #6 - Sep 8th, 2011 at 4:51am
Print Post  
I really dont know where I am wrong but still its not working for me

This is how I am doing in my application

Code
Select All
Diagram.RegisterItemClass(typeof(ChartNode), "classNodeId", 1);
string xml = e.Result; //e.result is coming from DB

 if (xml.Length > 0)
 ddtarget.LoadFromString(xml);

 ddtarget.LinkStyle = LinkStyle.Cascading;
 ddtarget.LinkSegments = 3;
 



Can you please provide one sample zip code for this where we save & load for same Link style?

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Anchor pattern changes while loading
Reply #7 - Sep 8th, 2011 at 10:17am
Print Post  
Could you explain more clearly what the problem is? Are you saying that the loaded links don't have the same link.Style as when they were saved?
  
Back to top
 
IP Logged
 
SL_developer
YaBB Newbies
*
Offline


coding rocks

Posts: 43
Joined: Jul 26th, 2011
Re: Anchor pattern changes while loading
Reply #8 - Sep 8th, 2011 at 11:00am
Print Post  
Yes, when I save the diagram Link style is Cascading



but if it loads from DB then Link style change

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Anchor pattern changes while loading
Reply #9 - Sep 8th, 2011 at 11:20am
Print Post  
Could you email the saved xml file to support@mindfusion.eu?
  
Back to top
 
IP Logged
 
SL_developer
YaBB Newbies
*
Offline


coding rocks

Posts: 43
Joined: Jul 26th, 2011
Re: Anchor pattern changes while loading
Reply #10 - Sep 8th, 2011 at 12:14pm
Print Post  
I have send you an email with xml file please check & let me know


Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Anchor pattern changes while loading
Reply #11 - Sep 8th, 2011 at 3:15pm
Print Post  
This is what we got:


Does it look different from what you saved in the file? The links shapes correspond exactly to the point coordinates that are saved in the file. It seems you are using a custom node type registered as "classNodeId", which our developer replaced with ShapeNodes in order to load the file. Does your custom type override the CreateConnectionPoint method by any chance?
  
Back to top
 
IP Logged
 
SL_developer
YaBB Newbies
*
Offline


coding rocks

Posts: 43
Joined: Jul 26th, 2011
Re: Anchor pattern changes while loading
Reply #12 - Sep 9th, 2011 at 5:02am
Print Post  
Hi
Yes diagram looks same.
My custom class not overriding CreateConnectionPoint method. Please tell me how to use it.
Also If I remove my custom class then with shapeNode what I need to do?


Thanks for Support 8)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Anchor pattern changes while loading
Reply #13 - Sep 9th, 2011 at 6:52am
Print Post  
Hi,

Check your code then, there should be some assignments to the links' Style or ControlPoints that change them to straight lines after calling LoadFromXml. If you think the problem is in LoadFromXml, try to reproduce it in a test project and email it to us for our developer to investigate.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint