Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DiagramNodeCollection (Read 1501 times)
Amosius
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 75
Joined: Sep 2nd, 2010
DiagramNodeCollection
Nov 10th, 2010 at 4:05pm
Print Post  
Hello,

i am confused with my DiagramNodeCollection.
I have a collection with 5 nodes and i insert one more:
Code
Select All
int i = 2;
ShapeNode node = new ShapeNode();
myDiagram.Nodes.Insert(i, node); 



Now i get the position of my node:
Code
Select All
int pos = myDiagram.Nodes.IndexOf(node); 



pos is not 2, it is 5. My Node is in the last position, instead of position 2.

Is there a problem with DiagramNodeCollection, or do I have a problem with my head Smiley

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramNodeCollection
Reply #1 - Nov 10th, 2010 at 4:17pm
Print Post  
Hi,

That would work if you were using a standalone DiagramNodeCollection, but the diagram's instance is a bit strange. Its Insert and Add methods raise an event that passes through the undo manager and adds the node both to diagram.Items and diagram.Nodes, but your index is lost in the process. We can try to add support for insertion too, but don't dare touching that code just now before the release Smiley

Stoyan
  
Back to top
 
IP Logged
 
Amosius
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 75
Joined: Sep 2nd, 2010
Re: DiagramNodeCollection
Reply #2 - Nov 10th, 2010 at 8:04pm
Print Post  
Hi Stoyan,

thx for this quick hint.
I created a "workaround". It's fine.

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