Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Restrict number of Outbound/Inbound Links (Read 3018 times)
donalmeida
Junior Member
**
Offline


Yay...

Posts: 65
Joined: Oct 6th, 2009
Restrict number of Outbound/Inbound Links
Nov 6th, 2009 at 6:51pm
Print Post  
There is a Property on the Shapenode that is:
Node.AllowIncomingLinks; Node.AllowOutgoingLinks;
On top of that, is there a property that I can set that restricts number of out bound or inbound routes. for example on a Start task we need to allow only one (1) outgoing route. 
Thanks Don
  

Don Almeida.
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Restrict number of Outbound/Inbound Links
Reply #1 - Nov 6th, 2009 at 7:19pm
Print Post  
There isn't such property. You could handle LinkCreating and LinkModifying to prevent the operation when the target node has the maximum number of incoming or outgoing links.

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


Yay...

Posts: 65
Joined: Oct 6th, 2009
Re: Restrict number of Outbound/Inbound Links
Reply #2 - Nov 6th, 2009 at 7:22pm
Print Post  
Sounds good.  I will do so.
Thanks,
Don Almeida.
  

Don Almeida.
Back to top
 
IP Logged
 
donalmeida
Junior Member
**
Offline


Yay...

Posts: 65
Joined: Oct 6th, 2009
Re: Restrict number of Outbound/Inbound Links
Reply #3 - Nov 10th, 2009 at 6:36pm
Print Post  
I tried to write this code, but it gets executed in a loop the moment I try to create a link from a start task;
private void diagram_LinkCreating(object sender, LinkValidationEventArgs e)
       {

// if Start Task
DiagramLinkCollection links = startNode.GetAllLinks();
                   if (links.Count > 1)
                   {
                       HandleErrors("Only one out bound route is allowed per Start task");
                       e.Cancel = true;
                       return;
                   }
}
what is th ebest way to cancel the event.
  

Don Almeida.
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Restrict number of Outbound/Inbound Links
Reply #4 - Nov 10th, 2009 at 8:21pm
Print Post  
Setting e.Cancel displays the stop cursor and prevents the operation at the current mouse position, but lets the user drag the handle to a different position. You could call e.CancelDrag() to cancel the operation immediately.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint