Share via


ClipboardCommandSet Class

Represents a subset of the commands that are available in menus in a domain-specific language. Override methods in YourLanguageClipboardCommandSet to modify how these commands are processed.

This API is not CLS-compliant. 

Inheritance Hierarchy

System.Object
  System.MarshalByRefObject
    Microsoft.VisualStudio.Modeling.Shell.CommandSetLibrary
      Microsoft.VisualStudio.Modeling.Shell.ClipboardCommandSet

Namespace:  Microsoft.VisualStudio.Modeling.Shell
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Shell.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Shell.10.0.dll)

Syntax

'Declaration
<CLSCompliantAttribute(False)> _
Public MustInherit Class ClipboardCommandSet _
    Inherits CommandSetLibrary
[CLSCompliantAttribute(false)]
public abstract class ClipboardCommandSet : CommandSetLibrary
[CLSCompliantAttribute(false)]
public ref class ClipboardCommandSet abstract : public CommandSetLibrary
[<AbstractClass>]
[<CLSCompliantAttribute(false)>]
type ClipboardCommandSet =  
    class
        inherit CommandSetLibrary
    end
public abstract class ClipboardCommandSet extends CommandSetLibrary

The ClipboardCommandSet type exposes the following members.

Constructors

  Name Description
Protected method ClipboardCommandSet Creates a new CommandSet

Top

Properties

  Name Description
Protected property CreateBitmapPreference
Protected property CurrentDocData (Inherited from CommandSetLibrary.)
Protected property CurrentDocumentSelection (Inherited from CommandSetLibrary.)
Protected property CurrentModelingDocView (Inherited from CommandSetLibrary.)
Protected property CurrentSelection (Inherited from CommandSetLibrary.)
Protected property ElementOperations
Protected property MenuService (Inherited from CommandSetLibrary.)
Protected property MonitorSelection (Inherited from CommandSetLibrary.)
Protected property SelectedElements
Protected property ServiceProvider (Inherited from CommandSetLibrary.)
Protected property SingleDocumentSelection (Inherited from CommandSetLibrary.)
Protected property SingleSelection (Inherited from CommandSetLibrary.)
Protected property TargetElement

Top

Methods

  Name Description
Protected method CanDeleteSelectedItems Returns true if the selected items can be deleted. (Inherited from CommandSetLibrary.)
Protected method CopyModelElementsIntoElementGroupPrototype Copies the collection of ModelElements to the specified IDataObject
Protected method CreateBitmapForClipboard Called on copy or cut to generate a bitmap that can be placed on the clipboard, given a set of shapes, or null to place no bitmap on the clipboard.
Protected method CreateMetafileForClipboard Called on copy or cut to generate a meta file for the Clipboard. The default implementation generates an enhanced metafile.
Public method CreateObjRef Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Protected method DeleteSelectedItems Delete the selected items. (Inherited from CommandSetLibrary.)
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetLifetimeService Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected method GetMenuCommands Defines the list of menu commands that this CommandSet implements. (Inherited from CommandSetLibrary.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Initialize Initialize the command set. Calls GetMenuCommands and caches the result. (Inherited from CommandSetLibrary.)
Public method InitializeLifetimeService Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected method IsAnyDocumentSelectionCompartment True if any of the items in the selection list is a compartment. (Inherited from CommandSetLibrary.)
Protected method IsAnyDocumentSelectionMoveableHostShape True if any of the items in the selection list is a moveable host shape, which cannot be deleted. (Inherited from CommandSetLibrary.)
Protected method IsAnyDocumentSelectionUndeletable True if any of the shape items in the selection list cannot be deleted. (Inherited from CommandSetLibrary.)
Protected method IsCurrentDiagramEmpty True if the diagram has no children. (Inherited from CommandSetLibrary.)
Protected method IsDiagramSelected True if the diagram is selected. (Inherited from CommandSetLibrary.)
Protected method IsSingleDocumentSelection True if there is only one selected item on the active document. (Inherited from CommandSetLibrary.)
Protected method IsSingleSelection True if there is only one selected item on the active document window or tool window. (Inherited from CommandSetLibrary.)
Protected method MemberwiseClone() Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method MemberwiseClone(Boolean) Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Protected method ProcessOnMenuCopyCommand Copies the selection to the clipboard. Override this method to change the behavior.
Protected method ProcessOnMenuCutCommand Copies the selection to the clipboard and deletes the elements from the model. Override this method to change the behavior.
Protected method ProcessOnMenuPasteCommand Inserts the clipboard content into the model. Override this method to change the behavior.
Protected method ProcessOnStatusCopyCommand Called to determine whether the Copy command should be enabled and visible on a menu. If you override this method, set cmd.Enabled and cmd.Visible.
Protected method ProcessOnStatusCutCommand Called to determine whether the Cut command should be enabled and visible on a menu. If you override this method, set cmd.Enabled and cmd.Visible.
Protected method ProcessOnStatusPasteCommand Called to determine whether the Paste command should be enabled and visible on a menu. If you override this method, set cmd.Enabled and cmd.Visible.
Protected method ResolveExportedShapesForClipboardImages Get the complete set of shapes and links that should be exported to the clipboard, given a set of model elements.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

When a set of model elements is to be copied to the clipboard, an IDataObject is prepared that contains: an ElementGroupPrototype containing the model elements; a bitmap of the shapes that present the model elements; and an Extended MetaFile of the shapes. The EGP can be used to paste into another DSL, UML diagram, or another application that understands the DSL. The bitmap and EMF versions can be used to paste images of the shapes into other applications such as PowerPoint.

For more information, see How to: Modify a Standard Menu Command in a Domain-Specific Language and How to: Add a Command to the Shortcut Menu.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Modeling.Shell Namespace