public static Node GetNthConnection(this Database.OutputTopologyEnumerable e, OutputPort port, int index) { var currIndex = 0; foreach (var filtered in e[port]) { if (currIndex == index) { return(filtered); } currIndex++; } throw new IndexOutOfRangeException("Index of connection or port does not exist"); }