Files
LanMountainDesktop/airapp/LanMountainDesktop.AirAppSdk/ISettingsService.cs

57 lines
1.6 KiB
C#
Raw Normal View History

2026-03-13 00:33:00 +08:00
using System.Collections.Generic;
2026-08-11 23:03:55 +08:00
namespace LanMountainDesktop.AirAppSdk;
2026-03-13 00:33:00 +08:00
public interface ISettingsService
{
event EventHandler<SettingsChangedEvent>? Changed;
2026-08-11 23:03:55 +08:00
T LoadSnapshot<T>(AirAppSettingsScope scope, string? subjectId = null, string? placementId = null) where T : new();
2026-03-13 00:33:00 +08:00
void SaveSnapshot<T>(
2026-08-11 23:03:55 +08:00
AirAppSettingsScope scope,
2026-03-13 00:33:00 +08:00
T snapshot,
string? subjectId = null,
string? placementId = null,
string? sectionId = null,
IReadOnlyCollection<string>? changedKeys = null);
T LoadSection<T>(
2026-08-11 23:03:55 +08:00
AirAppSettingsScope scope,
2026-03-13 00:33:00 +08:00
string subjectId,
string sectionId,
string? placementId = null) where T : new();
void SaveSection<T>(
2026-08-11 23:03:55 +08:00
AirAppSettingsScope scope,
2026-03-13 00:33:00 +08:00
string subjectId,
string sectionId,
T section,
string? placementId = null,
IReadOnlyCollection<string>? changedKeys = null);
void DeleteSection(
2026-08-11 23:03:55 +08:00
AirAppSettingsScope scope,
2026-03-13 00:33:00 +08:00
string subjectId,
string sectionId,
string? placementId = null);
T? GetValue<T>(
2026-08-11 23:03:55 +08:00
AirAppSettingsScope scope,
2026-03-13 00:33:00 +08:00
string key,
string? subjectId = null,
string? placementId = null,
string? sectionId = null);
void SetValue<T>(
2026-08-11 23:03:55 +08:00
AirAppSettingsScope scope,
2026-03-13 00:33:00 +08:00
string key,
T value,
string? subjectId = null,
string? placementId = null,
string? sectionId = null,
IReadOnlyCollection<string>? changedKeys = null);
IComponentSettingsAccessor GetComponentAccessor(string componentId, string? placementId);
}