Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem with SaveTo (Read 1644 times)
Diego
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Mar 3rd, 2010
Problem with SaveTo
Mar 3rd, 2010 at 6:22pm
Print Post  
Hi All,

I'm having an issue when saving a diagram using method SaveToFile.

I've created a class called DialogNodeView which extends class TableNode. I'm registering this class using the following code:

[code]Diagram.RegisterItemClass(typeof(DialogNodeView), "custom:DialogNodeView", 1);[/code]

The method "SaveToFile" works fine, it generates the file with no problems. Also, when I call "LoadFromFile" the diagram is loaded correctly and the DiagramNodeView instances are in their correct position. However, I'm not being able to move these instances neither create links from them or to them. It looks like the node is locked, but the Locked property is set to false.

I'm able to insert new nodes in the diagram and move them freely, so the diagram is not locked.


I've investigated a little further and discovered that the "Parent" property of the DiagramNodeView instances that have been loaded from the file are in null.


Should I do something else, in order to make this work?


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with SaveTo
Reply #1 - Mar 3rd, 2010 at 6:42pm
Print Post  
Hi,

Do the DialogNodeView constructors and SaveTo / LoadFrom overrides call the corresponding base methods? Could you email DialogNodeView.cs to support@mindfusion.eu?

Stoyan
  
Back to top
 
IP Logged
 
Diego
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Mar 3rd, 2010
Re: Problem with SaveTo
Reply #2 - Mar 3rd, 2010 at 7:17pm
Print Post  
Hi Stoyan

Thanks for your prompt response.

This is the class's default constructor:

[code]public DialogNodeView()

: this(new DialogNodeViewStyle())
{
}[/code]

The constructor that has the DialogNodeViewStyle parameter calls to the base constructor:
[code]public DialogNodeView(DialogNodeViewStyle nodeStyle) : base()
{
FormatTable();

this.NodeStyle = nodeStyle;
this.Refresh();

this.DoResize(_nodeStyle.DefaultWith, this.CaptionHeight);
}[/code]

I'm not overriding the SaveTo / LoadFrom methods.

Anyway, I'm sending the class code in a few minutes.

Thanks
Diego
  
Back to top
 
IP Logged
 
Diego
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Mar 3rd, 2010
Re: Problem with SaveTo
Reply #3 - Mar 3rd, 2010 at 8:09pm
Print Post  
Hi Stoyan,

I've fixed the issue.

I've added the following constructor in my class and worked:

[code]
public DialogNodeView(Diagram diagram)

: base(diagram)
{
}
[/code]

Thanks for you help

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