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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to know links from/to a symbol

Thread ID:





20458 Oct 19,2004 12:16 PM UTC Oct 26,2004 02:12 PM UTC WinForms 2
Tags: Diagram
Administrator [Syncfusion]
Asked On October 19, 2004 12:16 PM UTC

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 06:18 PM UTC

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 02:12 PM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon