public void RemovePort(int nodeId, int portIdx) { for (int i = 0; i < portList.Count; ++i) { PortInfo info = portList[i]; if (info.nodeId == nodeId && info.portIdx == portIdx) { portList.RemoveAt(i); return; } } }
public void RemoveByNodeId(int nodeId) { for (int i = 0; i < portList.Count;) { PortInfo info = portList[i]; if (info.nodeId == nodeId) { portList.RemoveAt(i); } else { ++i; } } }