/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Services/IAppStateService.cs
34 строки
1 KB
Michael Jolley
CmdPal: Make settings and app state immutable (#46451)
27 мар 2026, 20:54
Не верифицирован
27 мар 2026, 20:54
4337f8e
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Windows.Foundation; namespace Microsoft.CmdPal.UI.ViewModels.Services; /// <summary> /// Manages the lifecycle of <see cref="AppStateModel"/>: load, save, and change notification. /// </summary> public interface IAppStateService { /// <summary> /// Gets the current application state instance. /// </summary> AppStateModel State { get; } /// <summary> /// Persists the current state to disk and raises <see cref="StateChanged"/>. /// </summary> void Save(); /// <summary> /// Atomically applies a transformation to the current state, persists the result, /// and raises <see cref="StateChanged"/>. /// </summary> void UpdateState(Func<AppStateModel, AppStateModel> transform); /// <summary> /// Raised after state has been saved to disk. /// </summary> event TypedEventHandler<IAppStateService, AppStateModel> StateChanged; }