CommandSetLibrary Class

Definition

Important

This API is not CLS-compliant.

Base class for command classes interacts with visual studio commands. Contains DocData, DocView and selection related properties.

public ref class CommandSetLibrary abstract : MarshalByRefObject
[System.CLSCompliant(false)]
public abstract class CommandSetLibrary : MarshalByRefObject
public abstract class CommandSetLibrary : MarshalByRefObject
[<System.CLSCompliant(false)>]
type CommandSetLibrary = class
    inherit MarshalByRefObject
type CommandSetLibrary = class
    inherit MarshalByRefObject
Public MustInherit Class CommandSetLibrary
Inherits MarshalByRefObject
Inheritance
CommandSetLibrary
Derived
Attributes

Constructors

CommandSetLibrary(IServiceProvider)

Creates a new CommandSet

Properties

CurrentDocData

Currently focused document

CurrentDocumentSelection

Returns the collection of selected elements in the active document window.

CurrentModelingDocView

Currently focused document view

CurrentSelection

Returns the collection of selected elements in the active window. This could be a document window or tool window.

MenuService

Menu command service used to manage command handlers.

MonitorSelection

Service used to track selection in the Visual Studio shell.

ServiceProvider

Service provider used to retrieve Visual Studio services.

SingleDocumentSelection

Returns the primary selected object in the active document window.

SingleSelection

Returns the primary selected object in active window. This could be a document window or tool window.

Methods

CanDeleteSelectedItems()

Determine whether selected item can be deleted or not

DeleteSelectedItems(String)

Protected method to delete selected items

GetMenuCommands()

Provide the menu commands that this commandset implements

Initialize()

Initialize the command set

InitializeAsync(CancellationToken)
IsAnyDocumentSelectionCompartment()

Returns whether any of the items in the selection list is a compartment.

IsAnyDocumentSelectionMoveableHostShape()

Returns whether any of the items in the selection list is a moveable host shape, which cannot be deleted.

IsAnyDocumentSelectionUndeletable()

Returns whether any of the shape items in the selection list cannot be deleted. Base implementation checks for Compartment and MoveableHostShape shapes.

IsCurrentDiagramEmpty()

Returns true if diagram has no children.

IsDiagramSelected()
IsSingleDocumentSelection()

Returns whether or not there is only one selected item on the active document.

IsSingleSelection()

Returns whether or not there is only one selected item on the active window. This could be a document or tool window.

Applies to