Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Definition
Namespace: Microsoft.CommandPalette.Extensions.Toolkit
Inherits Setting<String>
The ChoiceSetSetting class represents a setting that allows users to select from a predefined set of choices. This is useful for applications that need to provide users with a limited set of options to choose from, such as selecting a theme or a configuration option.
Constructors
| Constructor | Description |
|---|---|
| ChoiceSetSetting(String, List<Choice>) | Initializes a new instance of the ChoiceSetSetting class with a specified name and a list of choices. |
| ChoiceSetSetting(String, String, String, List<Choice>) | Initializes a new instance of the ChoiceSetSetting class with a specified name, description, default value, and a list of choices. |
Nested classes
| Class | Description |
|---|---|
| Choice | Represents a single choice in the choice set. Each choice has a name and a value. The name is displayed to the user, while the value is used internally by the application. |
Properties
| Property | Type | Description |
|---|---|---|
| Choices | List<Choice> | Gets or sets the list of choices available in the choice set. Each choice is represented by an instance of the Choice class. |
Methods
| Method | Description |
|---|---|
| LoadFromJson(JsonObject) | Loads the setting from a JSON object. This is useful for applications that need to deserialize settings from a configuration file or other JSON source. |
| ToDictionary() | Converts the setting to a dictionary representation. This is useful for applications that need to serialize settings to a format that can be easily stored or transmitted. |
| ToState() | Converts the setting to a state representation. This is useful for applications that need to represent settings in a format that can be easily displayed or manipulated. |
| Update(JsonObject) | Updates the setting from a JSON object. This is useful for applications that need to apply changes to settings based on user input or other sources. |
Windows developer