We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to know links from/to a symbol

Thread ID:





20458 Oct 19,2004 08:16 AM Oct 26,2004 10:12 AM Windows Forms 2
Tags: Diagram
Administrator [Syncfusion]
Asked On October 19, 2004 08:16 AM

when I click a symbol, I want to know all links from it(TailPort) and all links to it (HeadPort). Any sample code? Thanks

Administrator [Syncfusion]
Replied On October 19, 2004 02:18 PM

Hi You should use the IGraphNode Interface to accomplish what you are seeking. Run this sample and add a few Symbols and Links. Select a Symbol and click on the "Change Link Colors" button. Here is the code snippet which changes the colors of the links coming into and leaving out of the selected instance of MySymbol: if ((this.diagram1.SelectionList.Count == 1) || (this.diagram1.SelectionList.First.GetType() == typeof(MySymbol))) { IGraphNode curNode = this.diagram1.SelectionList.First as IGraphNode; if (curNode != null) { IEnumerator enumedgesEntering = curNode.EdgesEntering.GetEnumerator(); IEnumerator enumedgesLeaving = curNode.EdgesLeaving.GetEnumerator(); //Incoming Links - Blue ICollection edgesEntering = curNode.EdgesEntering; while (enumedgesEntering.MoveNext()) { Link incomingLink = enumedgesEntering.Current as Link; incomingLink.LineStyle.LineColor = Color.Blue; } //Incoming Links - Blue ICollection edgesLeaving = curNode.EdgesLeaving; while (enumedgesLeaving.MoveNext()) { Link leavingLink = enumedgesLeaving.Current as Link; leavingLink.LineStyle.LineColor = Color.Red; } this.diagram1.Refresh(); } } Regards Arun

Administrator [Syncfusion]
Replied On October 26, 2004 10:12 AM

Thank you for help. Now my code works.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.