Partilhar via


CommandExtensionRegistrar Class

Definition

Base class for an ExtensionRegistar that can register ContextMenu command extensions

public ref class CommandExtensionRegistrar abstract : Microsoft::VisualStudio::Modeling::ExtensionEnablement::ExtensionRegistrar<Microsoft::VisualStudio::Modeling::ExtensionEnablement::ICommandExtension ^, System::Collections::Generic::IDictionary<System::String ^, System::Object ^> ^>
public abstract class CommandExtensionRegistrar : Microsoft.VisualStudio.Modeling.ExtensionEnablement.ExtensionRegistrar<Microsoft.VisualStudio.Modeling.ExtensionEnablement.ICommandExtension,System.Collections.Generic.IDictionary<string,object>>
type CommandExtensionRegistrar = class
    inherit ExtensionRegistrar<ICommandExtension, IDictionary<string, obj>>
Public MustInherit Class CommandExtensionRegistrar
Inherits ExtensionRegistrar(Of ICommandExtension, IDictionary(Of String, Object))
Inheritance

Constructors

CommandExtensionRegistrar()

Properties

CommandExtensionDefaultStartId

Provides the start Id of the dynamic Command Group in which the command extension will be placed. This value is used if a CommandExtension does not provide the MenuPlaceholderId value through MEF metadata.

CommandSetGuid

Provide the CommandSet GUID where commands will be placed

FilteredImports (Inherited from ExtensionRegistrarBase<T,TMetadataView>)
LazyImports

List of lazy imports after filtering was applied.

(Inherited from ExtensionRegistrarBase<T,TMetadataView>)
Logger
MenuService

Menu command service used to manage command handlers.

MetadataFilter

String-based Metadata Key that determines if a particular Exported Type can be imported or not. The default CanImport implementation filters imports based on this metadata key. The default value of this property is null indicating that no filter will be applied.

ServiceProvider
UnfilteredLazyImports

List of MEF-imported T.

(Inherited from ExtensionRegistrar<T,TMetadataView>)

Methods

CanImport(Lazy<ICommandExtension,IDictionary<String,Object>>)

Allow registrars that match the metadatafilter with a key in their metadata to be imported

CanImport(Lazy<T,TMetadataView>)

Determines if for a particular Lazy Import, the underlying exported object should be imported or not. The default implementation allows all imports.

(Inherited from ExtensionRegistrarBase<T,TMetadataView>)
Compare(Tuple<ICommandExtension,IDictionary<String,Object>>, Tuple<ICommandExtension,IDictionary<String,Object>>)
Compare(Tuple<T,TMetadataView>, Tuple<T,TMetadataView>)

Compares two imported objects of the same type.

(Inherited from ExtensionRegistrarBase<T,TMetadataView>)
Initialize(IServiceProvider)

Assigns a unique commandId to each imported command extension and registers the command with the MenuService. Only commandExtensions whose metadata match the MetadataFilter are registered.

Applies to