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

Code in new version required

Hi, I want to convert the following function into new syncfusion verion v.5.1.


void CreateLink(symbol SourceNode , symbol TargetNode)
{
LinkCmd objLinkCmd = new LinkCmd();
objNodeLink.LineBridgingEnabled = true;
objNodeLink.LineRoutingEnabled = true;
objLinkCmd.Link = objNodeLink;
objLinkCmd.SourcePort = SourceNode.leftport;
objLinkCmd.TargetPort = TargetNode.leftport;
this.objLNADiagramControl.Controller.ExecuteCommand(objLinkCmd);
}

Please guide me. I will be thankful to you.

Regards,

1 Reply

MF Meera Fathima Syncfusion Team May 31, 2007 11:59 AM UTC


Hello Ali,

Please find the below code snippet used in v5.1 to draw link between two nodes.

void CreateLink(MySymbol SourceNode , MySymbol TargetNode)
{
LineConnector line = new LineConnector(SourceNode.PinPoint, TargetNode.PinPoint);
line .LineBridgingEnabled = true;
line .LineRoutingEnabled = true;
this.diagram1.Model.AppendChild(line);

// Make connection between the two nodes and the line connector through its end point.
SourceNode.CentralPort.TryConnect(line.HeadEndPoint);
TargetNode.CentralPort.TryConnect(line.TailEndPoint);
}

Please let me know whether this is helpful to you.

Thanks for your interest in Syncfusion products.

Best Regards,
Meera.

Loader.
Live Chat Icon For mobile
Up arrow icon