Connections provide the properties
Source: the object that is the source of this connection (e.g. a FlowFragment or Hub or any other connectable object)
Target: the object that is the target of this connection (e.g. a FlowFragment or Hub or any other connectable object)
SourcePin: the pin object from where the connection originates. (The Parent of the pin is the same as the "Source" of the connection)
TargetPin: the pin object to which the connection is targeted. (The Parent of the pin is the same as the "Target" of the connection)
So if you only need to know if ObjectProxyA is connected to ObjectProxyB you can check like this
- Code: Select all
connection["Source"] == ObjectProxyA && connection["Target"] == ObjectProxyB
if that is found you may also check the pins if required. (e.g. If you only accept a connection which connects to the topmost input pin)
- Code: Select all
if ( (int)connection[TargetPin][PinIndex] == 0 )
{
// pin is connected to the topmost pin
}
Hope that helps