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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





36085 Oct 19,2005 06:59 PM UTC Oct 24,2005 02:12 PM UTC WinForms 4
Tags: Diagram
Chris C
Asked On October 19, 2005 06:59 PM UTC

We are currently evaluating your product. One of the things we need to do is traverse all of the links in the diagram. I understand how to do that using IGraphNode and IGraphEdge. In addition to determining the ToNode and FromNode, we also need to know what port the link is connected to on the symbol. I found that one of the link ports is a port on a symbol but the other port is a port anchored to the link. I need the port anchored on the other symbol. How do I get this? We still want the user to be able to add links to the diagram using the normal graphical interface. Ideally, we would like to see the SourcePort set to ToNode.MyPort and the TargetPort set to FromNode.MyPort. Thanks in advance for your help.

Administrator [Syncfusion]
Replied On October 20, 2005 05:14 AM UTC

Hi Chris, Links and symbols connect to each other through a Syncfusion.Windows.Forms.Diagram.Connection object. The Connection instance will have a reference to the ports on the two objects (the link and the symbol) that it is connecting. Assuming that you have the Port(on the Symbol or the Link) that makes up one part of the connection, the foreign or connecting port can be retrieved through this Connection class. The following KB articles should give you an idea how to go about using Connections to access the Symbols and Ports on either side of a link: http://www.syncfusion.com/Support/article.aspx?id=10556, http://www.syncfusion.com/support/kb/diagram/Default.aspx This link goes over the basics of how symbols, links, ports and connections all fit together - http://www.syncfusion.com/support/kb/diagram/Default.aspx. I hope this helps. Please let us know if we can assist you in any other way. Regards, Prakash Surendra Syncfusion Inc.,

Chris C
Replied On October 20, 2005 06:52 PM UTC

Hi Prakash, Thanks so much for the information. However, it still doesn''t quite solve my problem. For example, suppose I have two symbols, A and B and each one has a port, A.Port1 and B.Port1. I insert a link between the symbols using those ports. We would like to write some XML data to a separate file when we save the diagram. For each link we need the foreign ports on either side of a connection. If I loop through the connections for symbol A, I can get A.Port1 but how do I get B.Port1. I understand the example you pointed me at regarding the ConnectionsChangeComplete event but that actually happens in two parts. There is an event for one side of the connection and a separate event for the other side. We want to start with either a symbol or the link itself and determine both symbols ports in one step. Can this be done? I thought about having a custom link class and saving the information when the ConnectionsChangeComplete event fires. It seems like there should be an easier way to do it. We are very pleased with the evaluation thus far and almost certain that we will be using SyncFusion for our application development. Thanks for your help. Chris

Administrator [Syncfusion]
Replied On October 21, 2005 07:23 PM UTC

Hi Chris, I am glad that your evaluation of Essential Diagram is proceeding well. We will do our best to ensure that you remain satisfied with the Syncfusion experience. As for this issue, Symbols and Links have the SymbolBase.Connections property that you can use to iterate the list of connections that exist on the Symbol/Link. You could then use the Connection.GetForeignPort(IPortContainer) method to get hold of the connection''s foreign port. For instance, if you are working with the Link''s connections, then calling Connection.GetForeignPort(IPortContainer), where a reference to the Link will be the IPortContainer, will return the Port on the Symbol that the Link is connecting to. Once you have the Port, you can access the host Symbol by calling the Port.Container property. A similar approach can be used for retrieving the Link from the Symbol as well. The following code shows how to use a Link''s Connections collection to get hold of the Symbols on the tail and head ends of the Link, Link mylink; /*Reference to the link*/ ConnectionCollection connections = mylink.Connections; Symbol tailsymbol = null; Symbol headsymbol = null; foreach(Connection conn in mylink.Connections) { Port foreignport = conn.GetForeignPort(mylink); if((tailsymbol == null) && ((mylink.TailPort == conn.SourcePort) || (mylink.TailPort == conn.TargetPort))) { if(foreignport != null) tailsymbol = foreignport.Container as Symbol; } if((headsymbol == null) && ((mylink.HeadPort == conn.SourcePort) || (mylink.HeadPort == conn.TargetPort))) { if(foreignport != null) headsymbol = foreignport.Container as Symbol; } } Thanks, Prakash Surendra Syncfusion Inc.,

Chris C
Replied On October 24, 2005 02:12 PM UTC

Hi Prakash, Thanks so much for your help. That is exactly what I needed. We are definitely using Syncfusion for our development. Chris


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