Click or drag to resize

CopyContext Class

A context that identifies a complete copy operation. It is used to map old references to new references when doing a deep copy of a hierarchy of objects.
Inheritance Hierarchy

Namespace:  AGI.Foundation.Infrastructure
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.1.418.0 (24.1.418.0)
Syntax
public class CopyContext

The CopyContext type exposes the following members.

Constructors
  NameDescription
Public methodCopyContext
Initializes a new instance.
Top
Methods
  NameDescription
Public methodAddObjectMappingT
Adds a mapping between an old object reference and a new one. The default implementation of UpdateReferenceT(T) will substitute newObject everywhere it encounters oldObject.
Public methodClearObjectMapping
Clears the list of mappings that has been created with calls to AddObjectMappingT(T, T). This is useful if you want to reuse a CopyContext instance for a separate copy operation.
Protected methodCloneT
Copies the specified object using the ICloneWithContext interface or the ICloneable interface, with a preference on ICloneWithContext.
Public methodCloneIfNotMappedT
Looks for a mapping for this object that was added with AddObjectMappingT(T, T). If one is found, the object to which the specified one is mapped is returned. If one is not found, this method clones the given object by calling CloneT(T). Derived classes can override this default behavior.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetObjectMappingT
Gets the mapping for the specified object.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdateReferenceT
Updates a given reference, returning a reference to use in its place. The default implementation of this method looks for a mapping for this object that was added with AddObjectMappingT(T, T). If one is found, the object to which the specified one is mapped is returned. If one is not found, this method returns the object that was passed to it. Derived classes can override this default behavior.
Top
See Also