GoLabeledLink - AllowedPorts

Hi,
I programmatically add GoLabeledLink between objects. I want the user to be able to drag/drop the link endpoints from a port on one node to another port on the same object but not to any other node. Is this possible? How?
Regards / Mattias

Sure, just override GoToolLinkingNew and GoToolRelinking.IsValidLink, or GoPort.IsValidLink, depending on where you want to put the code (i.e. in the view/tools or in the port).
If you depend on the standard/default definitions at all, you’ll also need to set GoPort.IsValidSelfNode to true on every port of your node.
Hmmm, a quick search only reveals a couple of examples of this in the sample applications. But there are several examples of defining and installing custom linking tools.

Thanks,
I ended up using customized GoToolLinkingNew and GoToolRelinking the way you described it. Superb!
Regards / Mattias