GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoView Class / CopyToClipboard Method
In This Topic
    CopyToClipboard Method
    In This Topic
    Put a copy of a collection of objects in the clipboard.
    Syntax
    public virtual void CopyToClipboard( 
       IGoCollection coll
    )

    Parameters

    coll
    Remarks

    The collection is copied into a new document of the same class as the Document property value. (That document class must have a public zero-argument constructor.) This method then calls GoDocument.MergeLayersFrom this view's document and then calls GoDocument.CopyFromCollection to make a copy of all of the objects in coll in the new document in the appropriate layers. Note that in order to maintain the distinct layers of the objects being copied, each document layer needs to have a unique identifier, GoLayer.Identifier. The new document is then inserted into the clipboard using that document's GoDocument.DataFormat.

    To facilitate pasting into regular (not GoDiagram) documents, this method calls CreateDataObject to support additional data formats. If the coll is null or empty, the clipboard is cleared of any previous data values.

    All of the objects in the collection will be copied by serializing them. If any of the objects, or any of the objects that they refer to, are not serializable, there will be a serialization exception, and the clipboard might not a copy of the argument collection. Exceptions will be logged to any trace listeners. The User Guide discusses serialization and deserialization in more detail.

    See Also