/// <summary> /// Map old Guids to new Models in the IdReferenceResolver. /// </summary> /// <param name="node">The newly created node.</param> /// <param name="inPorts">The deserialized input ports.</param> /// <param name="outPorts">The deserialized output ports.</param> /// <param name="resolver">The IdReferenceResolver used during deserialization.</param> private static void RemapPorts(NodeModel node, PortModel[] inPorts, PortModel[] outPorts, IdReferenceResolver resolver) { foreach (var p in node.InPorts) { resolver.AddToReferenceMap(inPorts[p.Index].GUID, p); } foreach (var p in node.OutPorts) { resolver.AddToReferenceMap(outPorts[p.Index].GUID, p); } }