ConnectionPoints and Custom Ports

Hello,
I created a symbol model using the symbol designer sample, and added several ports (ConnectionPoints) to the symbol model.

I create a new node from the symbol model (palette) in runtime.

How can I access the ports on the node I created in runtime?

The Ports collection of my created node is empty at runtime. However the ports appear in the diagram (DrawPorts = true), and I can connect to them using the orthogonal link tool.

I tried adding ports (connection points) to my node in runtime. This worked fine, but I would prefer to use the ports I created in the symbol designer.


1 Reply

AM Ajeet M Syncfusion Team January 22, 2009 03:00 PM UTC

Hi Richard,

You can access the Ports of the Nodes included in the palette as follows:

------------

Load symbol palette:
this.paletteGroupView.LoadPalette(somePalette);

Get the Node's index, starting from "0" or "Zero" in the symbol palette "somePalette".

Get the Node from the index "nIndex" as follows:

Node someNode = this.paletteGroupView.Palette.Nodes[nindex];

Node someOtherNode = this.paletteGroupView.Palette.Nodes[nindex + 1];

Access the Nodes's ports from the Port's index as "pIndex" as follows:

someNode.Ports[pIndex].TryConnect(someConnector.HeadEndPoint);

someOtherNode.Ports[pIndex].TryConnect(someConnector.TailEndPoint);

------------

Let me know if this helps.

Happy Coding!
-Ajeet



Loader.
Up arrow icon