Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to know who is my parent and child of an arrow (Read 4632 times)
Mah
Guest


how to know who is my parent and child of an arrow
Aug 27th, 2005 at 12:16am
Print Post  
let say, i create 2 box and link them with an arrow. Then how i gonna to output the answer actually this arrow is linking with the 2 boxes?

how to identify it with a unique identity?

coz i plan to save the path and boxes value into database.
  
Back to top
 
IP Logged
 
Iva
Junior Member
**
Offline


MindFusion support

Posts: 55
Joined: Aug 6th, 2005
Re: how to know who is my parent and child of an a
Reply #1 - Aug 27th, 2005 at 10:33am
Print Post  
I am not sure I understand your first question:

- if you need to determine which two boxes are connected by a specific arrow, use the Arrow class' Origin and Destination properties.

- if you need two determine whether two boxes are linked in a specific direction and want to find the arrow that links them, use the boxes' IncomingArrows and OutgoingArrows collections, e.g.:

Arrow getLink(Box b1, Box b2)
{
  foreach (Arrow link in b1.OutgoingArrows)
    if (b2.IncomingArrows.Contains(link))
     return link;

  return null;
}
  
Back to top
 
IP Logged
 
Iva
Junior Member
**
Offline


MindFusion support

Posts: 55
Joined: Aug 6th, 2005
Re: how to know who is my parent and child of an a
Reply #2 - Aug 27th, 2005 at 10:38am
Print Post  
Regarding assigning uniquie identifiers to diagram items, use the Tag property to store these IDs. E.g.

box1.Tag = createUniqueID()

Here createUniqueID() is your function that creates GUIDs or other kind of identifiers. Later you can use the FindBox method to search for a box by its ID.

Assign the ID to a box after you create it programmatically, or in a BoxCreated event handler for boxes created interactively by the end user.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint