Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Assigning a ShapeNode from a DiagramNodeList to another deletes it from the origin list. (Read 1288 times)
Cyrinael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 22nd, 2016
Assigning a ShapeNode from a DiagramNodeList to another deletes it from the origin list.
Aug 22nd, 2016 at 7:36am
Print Post  
Hi,

I want to store a DiagramNodeList of ShapeNodes seperately to the Nodes in the Diagram. Both lists should contain the same nodes (reference equal). Sadly I cannot have the same ShapeNode in both lists, because if I assign the ShapeNode to the list, it is deleted in the Diagram and vice versa.
I also tried it with a List<ShapeNode> but the result was the same.

Code
Select All
 foreach (DiagramNode node in diagramNodeList)
                {
                    node.Id = shapeEntry.Key;
                    saveDiagram.Nodes.Add(node); //here the node gets removed from diagramNodeList
                }
 



As a result of the code above, an exception is thrown, because the origin list is modified.

I also think that in a previous build, this problem did not occur but I am not totally sure about that.

Best regards,

Cyrinael
  
Back to top
 
IP Logged
 
Cyrinael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 22nd, 2016
Re: Assigning a ShapeNode from a DiagramNodeList to another deletes it from the origin list.
Reply #1 - Aug 22nd, 2016 at 8:19am
Print Post  
I have found the problem.
The ShapeNodes in the list were displayed in another diagram and were deleted after the ShapeNode was added to the new Diagram.

Best regards,

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