Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Arrows - Limiting them (Read 1404 times)
GizmoHd
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Sep 18th, 2007
Arrows - Limiting them
Sep 18th, 2007 at 12:27pm
Print Post  
I want to be able to limit the arrows two and from an object. 

For example, BOX A is allowed to connect to only ONE additional Box. And Only One Box can connect To BOX A...

Basically, each item should allow one connection in.. and only one connection out.  Is there a simple method of accomplishing this task?

Thanks in advance
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrows - Limiting them
Reply #1 - Sep 18th, 2007 at 12:42pm
Print Post  
You can do that by handling the LinkCreating and LinkModifying validation events. E.g. this disables drawing an outgoing link from a node when the node already has at least one link:

private void diagram_LinkCreating(object sender, MindFusion.Diagramming.LinkValidationEventArgs e)
{
     if (e.Origin.OutgoingLinks.Count > 0)
           e.CancelDrag();// or set e.Cancel = true;
}

The difference between calling e.CancelDrag() and setting e.Cancel = true is that the former immediately stops the drawing operation, whereas the latter changes the mouse cursor to a stop icon but allows the user to continue drawing the link to a different location.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
GizmoHd
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Sep 18th, 2007
Re: Arrows - Limiting them
Reply #2 - Sep 18th, 2007 at 12:51pm
Print Post  
Thank you..

Much easier than I thought it would be.. Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint