Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Deserialization error with group (Read 4795 times)
cthompso
YaBB Newbies
*
Offline



Posts: 6
Joined: May 27th, 2009
Deserialization error with group
Aug 11th, 2009 at 8:51pm
Print Post  
I am using the trick where I attach a TextBox to the bottom of a node.  I get a null reference error when I deserialize the diagram.  If you comment out the "AttachTo" line of code below then there is no error.  This type of error does not occur if I replace the TextBox/DiagamNodeAdapter with another shape node for example.  Do you know what is causing this deserialization error?
      

       public Window1()
       {
           InitializeComponent();
           Diagram d = new Diagram();
           Content = d;
           ShapeNode shapeNode = d.Factory.CreateShapeNode(new Rect(10, 10, 20, 20));
           TextBox tb = new TextBox();
           tb.Text = "Test";
           d.Nodes.Add(tb);
           DiagramNodeAdapter adapter = (DiagramNodeAdapter)Diagram.GetDiagramItem(tb);
           adapter.Bounds = new Rect(shapeNode.Bounds.BottomLeft.X, shapeNode.Bounds.BottomLeft.Y, 40, 20);
           adapter.AttachTo(shapeNode, AttachToNode.BottomLeft);
           XmlDocument doc = new XmlDocument();
           d.SaveToXml(doc);
           d.LoadFromXml(doc);
       }
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Deserialization error with group
Reply #1 - Aug 12th, 2009 at 6:50am
Print Post  
We've reproduced it, our developer will try to fix this today.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Deserialization error with group
Reply #2 - Aug 12th, 2009 at 11:13am
Print Post  
This version should fix it:
https://mindfusion.eu/_beta/wpfdiag221.zip

Stoyan
  
Back to top
 
IP Logged
 
cthompso
YaBB Newbies
*
Offline



Posts: 6
Joined: May 27th, 2009
Re: Deserialization error with group
Reply #3 - Aug 19th, 2009 at 7:48pm
Print Post  
Thanks it worked.
  
Back to top
 
IP Logged
 
kc13
YaBB Newbies
*
Offline



Posts: 29
Joined: Jan 19th, 2009
Re: Deserialization error with group
Reply #4 - Sep 2nd, 2009 at 11:04pm
Print Post  
I have the same error whenever I add a TableNode to a diagram. Even if it is the only object in my diagram. The SaveToXml works fine... it fails on the LoadFromXml.

Will this patch also fix this?  When will it be "officially" released?  I can't use a beta release in our software.

Here's the node that I am adding:

Dim nod As MindFusion.Diagramming.Wpf.TableNode
nod = Me.Factory.CreateTableNode(0, 0, 100, 120, 2, 0)
nod.Font.Size = 8
nod.ConnectionStyle = MindFusion.Diagramming.Wpf.TableConnectionStyle.Table
nod.CaptionFormat.Alignment = StringAlignment.Center
nod.CaptionFormat.LineAlignment = StringAlignment.Center
nod.CellFrameStyle = MindFusion.Diagramming.Wpf.CellFrameStyle.None
nod.CaptionBackBrush = System.Windows.Media.Brushes.LightGray
nod.Brush = System.Windows.Media.Brushes.LemonChiffon
nod.AllowDrop = True
nod.Expandable = False
nod.EnableStyledText = True
nod.ResizeToFitText(True)
nod.Columns(0).ColumnStyle = ColumnStyle.FixedWidth
nod.Columns(0).Width = 10
nod.Columns(1).ColumnStyle = ColumnStyle.AutoWidth
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Deserialization error with group
Reply #5 - Sep 3rd, 2009 at 11:40am
Print Post  
This looks like a different bug, related to layout of the table caption. Our developer will debug it now.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Deserialization error with group
Reply #6 - Sep 3rd, 2009 at 12:16pm
Print Post  
Check the private messages page. The version there should fix that.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint