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.

set direction of start and endpoint of a link

Thread ID:

Created:

Updated:

Platform:

Replies:

52425 Nov 28,2006 09:36 AM Nov 28,2006 12:44 PM Windows Forms 1
loading
Tags: Diagram
Alexander Ulrich
Asked On November 28, 2006 09:36 AM

Hello,

I'm currently evaluating Essential Diagram and I'd like to know if it is possible to specify the link direction at a port. I managed to work out an example, where a symbol exactly has the same number of ports as links (trivial for you I think). Now I want to specify that specific ports, let's say the ports are at the top of the symbol, only allow links with a vertical first segment.

Do I have to implement such a feature by myself, or is it possible to modify a implemented class for this purpose?

Thank you for your comments,

Alex

J.Nagarajan [Syncfusion]
Replied On November 28, 2006 12:44 PM

Hi Alexander ,

Thanks for your interest in Essential Diagram. If your intention is to draw links to the ports at the top of the symbol then please refer to the following code snippet

//In Initialize component
this.diagram1.Model.LineRoutingEnabled=true;

//In AddLink Button click event
LinkCmd linkcmd = new LinkCmd();
for (int i = 0; i <=4; i++)
{
Link link = new Link(Link.Shapes.OrthogonalLine);
linkcmd.SourcePort = rectangle.Ports[i];
linkcmd.TargetPort = roundrect.Ports[i];
linkcmd.Link = link;
this.diagram1.Controller.ExecuteCommand(linkcmd);
}

Please refer to the attached sample. In this sample when you click on "AddSymbols" button you can load 2 symbols and when you click on the "Add Link" button then the link should be connected only on to ports on the top of the symbols.

I hope this will meet your requirement. Please give us some more details about your requirement or provide us some screen shots if this doesn't helps.

Regards,
Nagaraj

Dynamic Link.zip


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.

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.

;