Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Move DiagramItems between Diagrams (Read 1978 times)
stefski
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 31
Location: Norway
Joined: Jul 17th, 2009
Move DiagramItems between Diagrams
Mar 19th, 2012 at 10:30am
Print Post  
Hi,

in our application we need to be able to move the contents of one diagram into another diagram. I thought that this might be as easy as removing all the items from the Items collection of the first diagram and add them to the Items collection of the second diagram.

This does seem to work for a single diagram item (SvgNode), however, when moving a whole collection, where items are coupled (i.e. Nodes and Links), it seems that our Links are not being transferred - or at least not configured correctly.

Does there exist any kind of utility class for doing operations like this, or will I have to grow my own?

  

Kind regards

Steffen Skov
OLGA Application Architect
Schlumberger Information Solutions AS
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Move DiagramItems between Diagrams
Reply #1 - Mar 20th, 2012 at 7:29am
Print Post  
Hi,
Try this:

Code
Select All
void MoveContent(Diagram src, Diagram dst)
{
	foreach (DiagramItem item in src.Items)
		item.Selected = true;
	SelectionCopy copy = src.CopySelection(src, true, true);
	dst.PasteSelection(dst, copy, null, 0, 0);
	src.ClearAll();
	//dst.Selection.Clear();
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint