Delen via


IExternalSettingsProvider Interface

Definition

Controls a single region of external settings. Unified Settings will query for this object when the external settings region is shown in the UI.

public interface IExternalSettingsProvider
type IExternalSettingsProvider = interface
Public Interface IExternalSettingsProvider
Derived

Methods

GetEnumChoicesAsync(String, CancellationToken)

Gets the choices to show in a dynamic enum setting.

GetMessageTextAsync(String, CancellationToken)

Gets the current text of a dynamic message.

GetValueAsync<T>(String, CancellationToken)

Gets the current value of a registered setting in this external region.

OpenBackingStoreAsync(CancellationToken)

An external settings region's registration includes the ID of a string resource describing the backing store, like "In-memory only; resets on restart" or "Managed by NuGet.config". When the backing store is something that can be edited directly, like a text file, that string can surround the store name with '%', like "Managed by %NuGet.config%". The %-delimited span will be rendered as a link, and when it is clicked, Unified Settings will call this method. This method should open the backing store in an editor.

SetValueAsync<T>(String, T, CancellationToken)

Sets the value of a registered setting in this external region. If the external settings region has realtimeNotifications = false and this objects implements ICachingExternalSettingsProvider, this can update an in-memory cache without affecting the backing store (until CommitPendingChangesAsync(CancellationToken) is called). Otherwise, this method should update the backing store immediately.

Events

DynamicMessageTextChanged

Raised by the setting owner when the text of a dynamic message should be updated in the UI. This will result in a callback to GetMessageTextAsync(String, CancellationToken).

EnumSettingChoicesChanged

Raised by the setting owner when the choices for an enum setting should be updated in the UI. This will result in a callback to GetEnumChoicesAsync(String, CancellationToken).

ErrorConditionResolved

Raised by the setting owner when an error state affecting the entire external settings region (i.e. one with Scope == EntireRegion or Unknown) is resolved. This will trigger Unified Settings to remove the error UI and refresh the region.

SettingValuesChanged

Raised by the setting owner when one or more settings change in the backing store.

This can also be raised to indicate that an error state affecting a single setting (i.e. one with Scope == SingleSettingOnly) has been resolved.

Applies to