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.
Syncfusion Feedback

ConnectionPoints and Custom Ports

Thread ID:

Created:

Updated:

Platform:

Replies:

79081 Jan 20,2009 09:51 AM UTC Jan 22,2009 03:00 PM UTC Windows Forms 1
loading
Tags: Diagram
Richard Deverson
Asked On January 20, 2009 09:51 AM UTC

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.


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



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

;