Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to clone a Node? (Read 3885 times)
code
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Jan 28th, 2009
How to clone a Node?
Jan 28th, 2009 at 2:54pm
Print Post  
For example, I'd like to copy a Node when user hold the Ctrol key while drag the source Node. However, it seems there is no method to clone a Node?

Thanks!

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to clone a Node?
Reply #1 - Jan 28th, 2009 at 3:01pm
Print Post  
Yes, currently that's not possible. We can add some copy constructors for you in the next few days.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to clone a Node?
Reply #2 - Feb 4th, 2009 at 9:11am
Print Post  
This version adds copy constructors to all classes derived from DiagramItem:
https://mindfusion.eu/_temp/diaglite_cc.zip

You could use them like this:
Code
Select All
private void OnNodeDoubleClicked(object sender, NodeEventArgs e)
{
	ShapeNode shapeNode = e.Node as ShapeNode;
	ShapeNode shapeNode2 = new ShapeNode(shapeNode);
	diagram.Items.Add(shapeNode2);
}
 



We could not find a way to clone Silverlight controls, and if you are using ControlNodes, you will have to copy the properties of the hosted controls yourself.

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