Linking question

Is there a simple example for determing if a node can be linked to another one?
thanks in advance,
Fridi

To customize which links are “legal” or “valid” for your application, you need to either override GoToolLinking.IsValidLink or GoPort.IsValidLink, depending on where you would like to put the code.

e.g. in the port class:
public override bool IsValidLink(IGoPort toPort) {
bool valid = base.IsValidLink;
if (valid) {
check other things you care about, possibly set "valid = false"
}
return valid;
}

For the simplest cases, you might be able to just set the GoDocument.ValidCycle property.

Thank you so much.
What is the best point to instantiate my own Port subclass?
My Node class inherits GoTextNode and that has

GoPort CreatePort(int spot)

… so having an additional parameter ‘spot’, b ut I don’t know what to do with it …
If I then use my own port class, it has ugly big black ports in the palette view
and connecting the ports is very strange

OK, I found it hereWink

internal class WorkflowPort : GoPort {

public WorkflowPort(int spot) {
            Style = GoPortStyle.None;
            Size = new SizeF(4, 4);
            FromSpot = spot;
            ToSpot = spot;
        }
...
}