Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Checking for loops in diagram? (Read 1848 times)
nbourgogne
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: May 27th, 2011
Checking for loops in diagram?
May 27th, 2011 at 7:56pm
Print Post  
Hi all,

I just downloaded the trial version of diagramlite for Silverlight, and I was wondering if there is a built-in or recommended way of checking for loops?

I want to create some sort of workflow where loops are not allowed, and I'd like to know if there's some built-in functionality before I start iterating through each node to check for a loop.

Thanks!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Checking for loops in diagram?
Reply #1 - May 30th, 2011 at 6:32am
Print Post  
Hi,

You can use the PathFinder class for this. Its FindCycle method will let you find out if a cycle already exists.

If you need to prevent users from creating cycles interactively, call PathFinder.FindShortestPath(e.Destination, e.Origin) from the LinkCreating handler, and if it finds a path set e.Cancel = true; an existing path from destination to origin means the new link would create a cycle.

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


I love YaBB 1G - SP1!

Posts: 6
Joined: May 27th, 2011
Re: Checking for loops in diagram?
Reply #2 - May 30th, 2011 at 1:30pm
Print Post  
Cool, thanks, I'll try it out!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint