Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram.AllowLinksRepeat (Read 1334 times)
Benoit Caron
YaBB Newbies
*
Offline



Posts: 10
Joined: Apr 8th, 2009
Diagram.AllowLinksRepeat
Apr 8th, 2009 at 8:52pm
Print Post  
Hello everyone,

I have set the Diagram.AllowLinksRepeat property to "false" to prevent... links repetition!

I seems to only prevent repetition for a link in the same direction.

Looking at the online documentation, the general description is:

"Gets or sets a value indicating whether more than one link can connect the same origin and destination diagram nodes."

but the remarks is:

"Specifies whether more than one link can connect the same origin and destination diagram nodes. If set to false, two diagram nodes can be connected with at most one link in a single direction."

So I guess I have my answer...

Can someone confirm that the property only prevent links in the same direction as the existing one?

Is there any other property I can use to prevent link repetition regardless of the existing link direction?

thanks,
Benoît Caron
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram.AllowLinksRepeat
Reply #1 - Apr 9th, 2009 at 7:58am
Print Post  
Hi,

There isn't such property. You can still do this with some event handling. E.g. handle LinkCreating or LinkModifying, call PathFinder.FindPath(destination, origin), and set e.Cancel = true if the path found contains one link. You might skip the check for how many links are there in the path if you want to prevent cycles of arbitrary length in the graph.

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



Posts: 10
Joined: Apr 8th, 2009
Re: Diagram.AllowLinksRepeat
Reply #2 - Apr 9th, 2009 at 1:53pm
Print Post  
Hello,

I ended up using LinkCreated and did my own check (but I needed to delete the created link).  Your way sounds better Smiley

Thansk again for all the informations.

Benoît
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint