Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 2.3 KB

File metadata and controls

40 lines (29 loc) · 2.3 KB
title TextSetting Class definition
description The TextSetting class represents a setting that allows users to input text in the PowerToys Command Palette.
ms.date 2/26/2025
ms.topic reference
no-loc
PowerToys
Windows
Insider

TextSetting Class

Definition

Namespace: Microsoft.CommandPalette.Extensions.Toolkit

Inherits Setting<String>

The TextSetting class represents a setting that allows users to input text. It is a specialized type of setting that can be used in the Command Palette to capture user input in a text format. This class provides properties and methods to manage the text input, including support for multiline input and placeholder text.

Constructors

Constructor Description
TextSetting(String, String) This constructor initializes a new instance of the TextSetting class with a specified name and description.
TextSetting(String, String, String, String) This constructor initializes a new instance of the TextSetting class with a specified name, description, default value, and placeholder text.

Properties

Property Type Description
Multiline Boolean Indicates whether the text input should support multiple lines.
Placeholder String The placeholder text that is displayed when the input field is empty.

Methods

Method Description
LoadFromJson(JsonObject) Loads the setting from a JSON object. This method is used to deserialize the setting from a JSON representation.
ToDictionary() Converts the setting to a dictionary representation. This method is useful for serializing the setting for storage or transmission.
ToState() Converts the setting to a state representation. This method is useful for capturing the current state of the setting for storage or transmission.
Update(JsonObject) Updates the setting with values from a JSON object. This method is used to apply changes to the setting based on a JSON representation.