Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic outgoinglinks and incominglinks (Read 1512 times)
Ivan Gamo
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 30
Joined: Nov 10th, 2012
outgoinglinks and incominglinks
Dec 19th, 2012 at 5:25pm
Print Post  
hi. i want to know how to work with incoming and outgoing links? because I'm creating a flowcharting diagram. and i want to know how the links working. thnks in advance! Smiley
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: outgoinglinks and incominglinks
Reply #1 - Dec 19th, 2012 at 6:06pm
Print Post  
Hi,

You can access node's links via the OutgoingLinks and IncomingLinks collections. If the nodes are tables with ConnectionStyle set to Rows, links will be in the respective Row object collections instead in the node's ones, or you could use GetAllIncomingLinks and GetAllOutgoingLinks methods to get links for all rows. If you don't care about link directions, you could call node.GetAllLinks() to get a list of both in- and out- links.

Here's some sample code showing a couple of ways to access neighbor nodes - via the link collections or the Query method:

Code
Select All
private void diagram_NodeClicked(object sender, NodeEventArgs e)
{
	if (e.MouseButton == MouseButton.Left)
	{
		foreach (var link in e.Node.OutgoingLinks)
			link.Destination.Brush = new SolidBrush(Color.LightGreen);
		foreach (var link in e.Node.IncomingLinks)
			link.Origin.Brush = new SolidBrush(Color.LightBlue);
	}
	if (e.MouseButton == MouseButton.Right)
	{
		foreach (var node in e.Node.Query("outlinks/destination"))
			node.Brush = new SolidBrush(Color.LightGreen);
		foreach (var node in e.Node.Query("inlinks/origin"))
			node.Brush = new SolidBrush(Color.LightBlue);
	}
} 



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


I Love MindFusion!

Posts: 30
Joined: Nov 10th, 2012
Re: outgoinglinks and incominglinks
Reply #2 - Dec 20th, 2012 at 10:06am
Print Post  
Thnak you stoyan. Grin
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint