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

More then one link between two symbols

Hi, do anybody have a solution for my problem: i want to connect two symbols with more than one link because every link represent a different condition. It´s no problem to create the links, but i could only see one line in the diagram and when i click on the link i get only the first link. Any help would be appreciated.

7 Replies

AD Administrator Syncfusion Team February 15, 2005 04:47 PM UTC

Hi Kai, Looks like you are using the same set of ports for both your links. Have you considered using multiple ports that have a small offset between them while designing your symbols? Forming links between such pairs of offset ports will let you distinguish between the different links. Regards, Prakash Surendra, Syncfusion, Inc.,

KA kabesser February 15, 2005 05:10 PM UTC

Hi Prakash, you''re right, i´m using allways the same port. Is it possible to create new ports dynamicly or only at design time ? Do I right understand , that i must create a new port only at the tail of the link ? How could i distinguish between the incomming and outgoing link, because i want to connect all incomming links with the center port ? Many regards Kai

AD Administrator Syncfusion Team February 16, 2005 03:56 PM UTC

Kai, Ports can be added to symbols at both runtime and design-time. To add a Port to a symbol, first create an instance of the Diagram.Port class, set the required properties for the port(the Radius, Location in world coordinates, Size, Visible etc.,) and add it to the symbol''s PortsCollection using the Symbol.Ports property. Normally an outgoing Link will form a connection with the symbol''s port with it''s SourcePort, while an incoming link will be connected through the links'' TargetPort. The Port.Container property for the source and target ports will be the symbol that the respective ports are associated with. Assuming that you have access to the Link, either through the LinkTool or the LinkCmd, then examining the Link''s SourcePort/TargetPort values and their Containers will let you determine whether the link is of the incoming or the outgoing type. Prakash Syncfusion, Inc

KA kabesser February 17, 2005 11:23 AM UTC

Hi Prakash, thank you for your tips, but one question please: I use the base code for my member symbols from your Orga example. When i connect two symbols the programm calls two times the "public override bool AcceptConnection(Port sourcePort, Port targetPort)" method. At the first call i will be at the source symbol. At this time, i have no information about the target symbol, correct ? How can i determine to create a new port or to use the existing port ? It´s possible to check if a connection for the target symbol allready exist ? Thank you for your assistance. cu Kai

KA kabesser February 18, 2005 05:13 PM UTC

Hi, again one question: when i connect two symbols, how can i redirect the port of the destination symbol from the default center port to another port ? Is there an event or methode to override ? Thanks cu Kai

AD Administrator Syncfusion Team February 18, 2005 09:31 PM UTC

Kai, Attempting to intercept the Link formation from within one of your Symbols is not the correct approach. You will have to specify the source and target ports that you want the link to connect to while creating the LinkCmd object for performing the connection. If your idea is to use the interactive LinkTool for creating the links, then replace the default LinkTool with a custom LinkTool implementation that will let you configure as required the LinkCmd object that it uses for creating the link. From within your custom LinkTool class''s IMouseEventReceiver.MouseUp() method, you will have access to the SourcePort and TargetPort ports that will be connected by the link. The Port.Container property for each of these ports will return the Symbol that houses the respective port. Based on this, you can determine whether the source or target port requires to be replaced with a different port on the Symbol, and if so, set this new port as the source/target for the LinkCmd. Referring to the base LinkTool.IMouseEventReceiver.MouseUp(MouseEventArgs) implementation in the Diagram\Src\Tools\LinkTools.cs file should give you an idea how to go about creating your custom LinkTool class. Regards, Prakash Syncfusion, Inc

KA kabesser February 19, 2005 05:47 PM UTC

Hi Prakash it was a little bit tricky, but now it works ! Thank you for your assistance. cu Kai

Live Chat Icon For mobile
Up arrow icon