Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 2.48 KB

File metadata and controls

45 lines (34 loc) · 2.48 KB
title CommandProvider Class
description The CommandProvider class is a base class for creating command providers in the Command Palette.
ms.date 2/19/2025
ms.topic reference
no-loc
PowerToys
Windows
Insider

CommandProvider Class

Definition

Namespace: Microsoft.CommandPalette.Extensions.Toolkit

Implements ICommandProvider

The CommandProvider class is a base class for creating command providers in the Command Palette. It provides a set of properties and methods to manage commands, including top-level commands and fallback commands. The class also supports event handling for changes in command items.

Properties

Property Type Description
DisplayName String The display name of the command provider.
Frozen Boolean Indicates whether the command provider is frozen. A frozen provider cannot be modified.
ICommandProvider.Icon IIconInfo The icon associated with the command provider.
Icon IconInfo The icon associated with the command provider.
Id String The unique identifier of the command provider.
Settings ICommandSettings The settings associated with the command provider.

Events

Event Description
Windows.Foundation.TypedEventHandler<object, IItemsChangedEventArgs> ItemsChanged Invoked when the command provider's items change.

Methods

Method Description
Dispose() Releases the resources used by the command provider.
FallbackCommands() Returns the fallback commands for the command provider.
GetCommand(String) Retrieves a command by its ID.
InitializeWithHost(IExtensionHost) Initializes the command provider with the specified host.
RaiseItemsChanged(Int) Raises the ItemsChanged event with the specified change type.
TopLevelCommands() Returns the top-level commands for the command provider.