Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic type node (Read 1374 times)
BidMaestro
Junior Member
**
Offline


to learn is to live

Posts: 74
Location: Australia
Joined: Apr 20th, 2008
type node
May 17th, 2009 at 11:28am
Print Post  
Stoyo

Could not find help on forum for this one and I am guessing you have probably dealt with this before.

I have created a diagram full of shapenodes and have just added my first tablenode. My code loops the collection using a 'for each loop' (vb.net) I used your coding example from the developers help file.

Dim n As DiagramNode

For Each n In Diagram.Nodes

Dim b As ShapeNode = CType(n, ShapeNode)
If Not b Is Nothing Then
End If

Next

However I am obtaining the following error
13 Unable to cast object of type 'MindFusion.Diagramming.TableNode' to type 'MindFusion.Diagramming.ShapeNode'.

Is there an easy way to exclude the tablenode from my 'for each loop' or determine the node type before processing?

I did have success in using the following code to identify a Tablenode

If ChartNodeDN.GetType.ToString = "MindFusion.Diagramming.TableNode" Then
' skip this node
End If

Doug

« Last Edit: May 17th, 2009 at 1:26pm by BidMaestro »  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: type node
Reply #1 - May 18th, 2009 at 7:28am
Print Post  
Hi Doug,

Try this:

' skip this node
If TypeOf node Is TableNode Then Continue For

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
BidMaestro
Junior Member
**
Offline


to learn is to live

Posts: 74
Location: Australia
Joined: Apr 20th, 2008
Re: type node
Reply #2 - May 18th, 2009 at 8:57am
Print Post  
Stoyo

You solution is far more elegant than my dinosaur.

You may wish to consider incorporating your solution in the Developers Guide rather than the Reflection technique.

Thanks again

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