Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Nodes collection (Read 1659 times)
kc13
YaBB Newbies
*
Offline



Posts: 29
Joined: Jan 19th, 2009
Nodes collection
Mar 5th, 2009 at 11:38pm
Print Post  
I have added several shapenodes on a diagram and I also can save the diagram (as xml) and then load the diagram.  Everything works fine and all my links and shapes are on the diagram.  But, when I loop through the Diagram.Nodes collection, it does not give me all the nodes.  (I have stepped through it in debugger one node at a time).  The one that is missing is the only one that I have set a custom image.

Here's how i add the node (where _Rect.. is a rect object set previously):

Dim nodNewActivity As MindFusion.Diagramming.Wpf.ShapeNode = Me.Factory.CreateShapeNode(_RectDefaultNodePosition, Me.DefaultShape)

       If _MyBitmapImage IsNot Nothing Then
           nodNewActivity.Shape = MindFusion.Diagramming.Wpf.Shapes.RoundRect
           nodNewActivity.Image = _MyBitmapImage
           nodNewActivity.Resize(100, 100)
           nodNewActivity.Transparent = True
       End If


Here's the loop:

For Each nod As MindFusion.Diagramming.Wpf.ShapeNode In DiagramWorkflow.Nodes
...
Next

The node with my image does not seem to be included when looping through collection.  But, like i said, if I save the diagram using SaveToXml and then open the xml in notepad the node is there... and i can re-load the diagram using LoadFromXml just fine also.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Nodes collection
Reply #1 - Mar 6th, 2009 at 6:02am
Print Post  
Doesn't diagram.Nodes.Count increase after the CreateShapeNode call?
  
Back to top
 
IP Logged
 
kc13
YaBB Newbies
*
Offline



Posts: 29
Joined: Jan 19th, 2009
Re: Nodes collection
Reply #2 - Mar 6th, 2009 at 1:39pm
Print Post  
Embarrassed

Sorry... we found the problem.  The collection is fine.  Our logic caused the node to be skipped (as intended) while processing ... Never looked at the obvious.  We were debugging further down inside the loop and never looked at the "If" right after For...
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint