Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Custom node serialization problem in 5.0.1 (Read 2318 times)
yeoupooh
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Sep 27th, 2007
Custom node serialization problem in 5.0.1
Nov 7th, 2007 at 5:39am
Print Post  
Hi,

I got an ArgumentNullException with testing custom node serialization using IconNodes demo application in FlowChart.NET 5.0.1.
I think IconNodes application has a problem in serialization part.

My IconNodes MainForm.cs code here.
---
(button1 for copy, button2 for paste)
...
       private void button1_Click(object sender, EventArgs e)
       {
           diagramView.CopyToClipboard(false);

       }

       private void button2_Click(object sender, EventArgs e)
       {
           diagramView.PasteFromClipboard(0, 0);

       }

---

How should I do to fix it?

Thanks in advance.
Jinwoo
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom node serialization problem in 5.0.1
Reply #1 - Nov 7th, 2007 at 10:37am
Print Post  
Hi,

For Copy & Paste to work correctly, you must either implement the DiagramItem.Clone() method, or add a copy constructor. E.g.

Code
Select All
public IconNode(IconNode prototype) : base(prototype)
{
	icon = prototype.icon;
	label = prototype.label;
	format = prototype.format;
}
 



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


I love YaBB 1G - SP1!

Posts: 8
Joined: Sep 27th, 2007
Re: Custom node serialization problem in 5.0.1
Reply #2 - Nov 8th, 2007 at 12:09am
Print Post  
It works perfectly.   Wink

Thank you, Stoyo.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint