My diagram is full of only objects which have a parent-to-child relationship. Each child node has a port called ‘InPort’ and there will always be only one link (or no links) to it. If there is a link, it will connect to some port on the parent. From the child, I’d like to be able to return the port I’m currently connected to on the parent.
I’ll attach the code I’m currently using, but I’ve just got to believe there’s a better way. Any suggestions? Thanks guys.
/// Gets the port on the schedule parent where this node is connected.
public GoPort ScheduleParentPort
// Could be schedule with no ‘In’ port
if (inPort == null) return null;
// Could not be connected
if (inPort.SourceLinksCount == 0) return null;
// Get the links
GoPortFilteredLinkEnumerator Links = inPort.SourceLinks;
// Move to first link
// Return the link port