LinkCmd in V5

Hi, Can you please guide me how can I connect two node. In last version there was LinkCmd that can connect two node. How I can get same functionality in V5. I will be thankful to you. I am using Version 5.1.0.51
Regards


1 Reply

J. J.Nagarajan Syncfusion Team July 18, 2007 03:19 PM UTC

Hi Ali,

Thanks for your interest in Syncfusion product. The LinkCmd class has been removed and use lineConnector or OrthogonalConnector instead. Please refer to the following code snippet

//Create NodeCollection to all nodes.
NodeCollection symbols = new NodeCollection();

//Create CustomNode1
MySymbol symbol1 = new MySymbol();
symbol1.PinPoint = new PointF(100 + symbol1.PinPointOffset.Width, 10 + symbol1.PinPointOffset.Height);
symbol1.EnableCentralPort = true;
symbols.Add(symbol1);

//Create CustomNode2
MySymbol symbol2 = new MySymbol();
symbol2.PinPoint = new PointF(300, 200);
symbol2.EnableCentralPort = true;
symbols.Add(symbol2);

int position = 0;

//Create OrthogonalConnector
OrthogonalConnector line = new OrthogonalConnector(symbol1.PinPoint, symbol2.PinPoint);

symbols.Add(line);

this.diagram.Model.AppendChildren(symbols, out position);

symbol1.CentralPort.TryConnect(line.HeadEndPoint);
symbol2.CentralPort.TryConnect(line.TailEndPoint);

this.diagram.Model.EndUpdate();

I have attached the sample that demonstrates this completely. You can download the sample from the following page.

http://websamples.syncfusion.com/samples/Diagram.Windows/F64323/main.htm

Please refer to the sample and let me know if you have any questions.

Thanks,
Nagaraj

Loader.
Up arrow icon