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

More then one link between two symbols

Thread ID:

Created:

Updated:

Platform:

Replies:

24880 Feb 12,2005 09:55 AM UTC Feb 19,2005 05:47 PM UTC WinForms 7
loading
Tags: Diagram
kabesser
Asked On February 12, 2005 09:55 AM UTC

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.

Administrator [Syncfusion]
Replied On 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.,

kabesser
Replied On 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

Administrator [Syncfusion]
Replied On 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

kabesser
Replied On 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

kabesser
Replied On 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

Administrator [Syncfusion]
Replied On 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

kabesser
Replied On 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

CONFIRMATION

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.

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

;