| Parameter | Description |
|---|---|
| output | The output port from which the connection originates. |
| input | The input port to which the connection is being made. |
bool
true if a connection between the specified ports is allowed; otherwise, false.
Determines whether a connection between the specified output and input ports is allowed.
The default implementation checks type compatibility by verifying that the input port's
IPort.DataType is assignable from the output port's IPort.DataType.
This allows connections between ports of the same type or where the output type is derived
from the input type.
Override this method in derived graph classes to implement custom connection validation logic,
such as additional type constraints, node-specific rules, or graph-level restrictions.
public override bool IsConnectionAllowed(IPort output, IPort input) { // Allow connection if the output is a string and the input is an int if (output.DataType == typeof(string) && input.DataType == typeof(int)) return true;
// Fallback on the default behaviour return base.IsConnectionAllowed(output, input); }