The IdReferenceResolver class allows us to use the Guid of an object as the reference id during serialization.
Inheritance: IReferenceResolver
示例#1
0
 /// <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);
     }
 }
示例#2
0
 /// <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);
     }
 }