GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoCopyDictionary Class / Copy Method
In This Topic
    Copy Method (GoCopyDictionary)
    In This Topic
    Return a copied object for an object (first pass only).
    Syntax
    public virtual GoObject Copy( 
       GoObject obj
    )

    Parameters

    obj
    Remarks

    First this method looks up obj in its mapping table--if it finds an object, it returns it, because presumably it has already been copied. Otherwise it calls GoObject.GoObject.CopyObject in order to make a copy of obj. If obj is null, this returns null.

    The primary use of this method is to be called by GoDocument's GoDocument.CopyFromCollection(IGoCollection, bool, bool, SizeF, GoCopyDictionary) method. This is also typically called within a GoObject.CopyObject override method to make a copy of a referenced object that is not a child of the copied object.

    If you don't call this in the context of a GoDocument.CopyFromCollection(IGoCollection, bool, bool, SizeF, GoCopyDictionary) method, be sure to call FinishDelayedCopies afterwards to perform the second copying pass, which resolves references and can do other copying work as implemented by GoObject.GoObject.CopyObjectDelayed.

    The easiest way to make a full copy of an object in a document is to call GoDocument.GoDocument.AddCopy, which calls CopyFromCollection. However, if you want to create a copy of an object without adding it to a document, you can call CopyComplete, which performs both copying passes.

    See Also