Files
LanMountainDesktop/airapp/LanMountainDesktop.AirAppSdk/AirAppSettingsSectionDefinition.cs

54 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
2026-08-11 23:03:55 +08:00
public sealed class AirAppSettingsSectionDefinition
2026-03-13 00:33:00 +08:00
{
2026-08-11 23:03:55 +08:00
public AirAppSettingsSectionDefinition(
2026-03-13 00:33:00 +08:00
string id,
string category,
2026-08-11 23:03:55 +08:00
AirAppSettingsScope scope,
2026-03-13 00:33:00 +08:00
string titleLocalizationKey,
string? descriptionLocalizationKey = null,
string iconKey = "Settings",
int sortOrder = 0,
string? subjectId = null,
2026-08-11 23:03:55 +08:00
IReadOnlyList<AirAppSettingOptionDefinition>? options = null)
2026-03-13 00:33:00 +08:00
{
ArgumentException.ThrowIfNullOrWhiteSpace(id);
ArgumentException.ThrowIfNullOrWhiteSpace(category);
ArgumentException.ThrowIfNullOrWhiteSpace(titleLocalizationKey);
ArgumentException.ThrowIfNullOrWhiteSpace(iconKey);
Id = id.Trim();
Category = category.Trim();
Scope = scope;
TitleLocalizationKey = titleLocalizationKey.Trim();
DescriptionLocalizationKey = string.IsNullOrWhiteSpace(descriptionLocalizationKey)
? null
: descriptionLocalizationKey.Trim();
IconKey = iconKey.Trim();
SortOrder = sortOrder;
SubjectId = string.IsNullOrWhiteSpace(subjectId) ? null : subjectId.Trim();
Options = options ?? [];
}
public string Id { get; }
public string Category { get; }
2026-08-11 23:03:55 +08:00
public AirAppSettingsScope Scope { get; }
2026-03-13 00:33:00 +08:00
public string TitleLocalizationKey { get; }
public string? DescriptionLocalizationKey { get; }
public string IconKey { get; }
public int SortOrder { get; }
public string? SubjectId { get; }
2026-08-11 23:03:55 +08:00
public IReadOnlyList<AirAppSettingOptionDefinition> Options { get; }
2026-03-13 00:33:00 +08:00
}