mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-21 16:14:28 +08:00
74 lines
2.3 KiB
C#
74 lines
2.3 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace LanMountainDesktop.Models;
|
|
|
|
public sealed class ComponentSettingsSnapshot
|
|
{
|
|
public string DailyArtworkMirrorSource { get; set; } = DailyArtworkMirrorSources.Overseas;
|
|
|
|
public List<ImportedClassScheduleSnapshot> ImportedClassSchedules { get; set; } = [];
|
|
|
|
public string ActiveImportedClassScheduleId { get; set; } = string.Empty;
|
|
|
|
public bool StudyEnvironmentShowDisplayDb { get; set; } = true;
|
|
|
|
public bool StudyEnvironmentShowDbfs { get; set; }
|
|
|
|
public string DesktopClockTimeZoneId { get; set; } = "China Standard Time";
|
|
|
|
public string DesktopClockSecondHandMode { get; set; } = "Tick";
|
|
|
|
public List<string> WorldClockTimeZoneIds { get; set; } =
|
|
[
|
|
"China Standard Time",
|
|
"GMT Standard Time",
|
|
"AUS Eastern Standard Time",
|
|
"Eastern Standard Time"
|
|
];
|
|
|
|
public string WorldClockSecondHandMode { get; set; } = "Tick";
|
|
|
|
public bool CnrDailyNewsAutoRotateEnabled { get; set; } = true;
|
|
|
|
public int CnrDailyNewsAutoRotateIntervalMinutes { get; set; } = 60;
|
|
|
|
public bool DailyWordAutoRefreshEnabled { get; set; } = true;
|
|
|
|
public int DailyWordAutoRefreshIntervalMinutes { get; set; } = 360;
|
|
|
|
public bool BilibiliHotSearchAutoRefreshEnabled { get; set; } = true;
|
|
|
|
public int BilibiliHotSearchAutoRefreshIntervalMinutes { get; set; } = 15;
|
|
|
|
public ComponentSettingsSnapshot Clone()
|
|
{
|
|
var clone = (ComponentSettingsSnapshot)MemberwiseClone();
|
|
|
|
var schedules = new List<ImportedClassScheduleSnapshot>(ImportedClassSchedules?.Count ?? 0);
|
|
if (ImportedClassSchedules is not null)
|
|
{
|
|
foreach (var schedule in ImportedClassSchedules)
|
|
{
|
|
if (schedule is null)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
schedules.Add(new ImportedClassScheduleSnapshot
|
|
{
|
|
Id = schedule.Id,
|
|
DisplayName = schedule.DisplayName,
|
|
FilePath = schedule.FilePath
|
|
});
|
|
}
|
|
}
|
|
|
|
clone.ImportedClassSchedules = schedules;
|
|
clone.WorldClockTimeZoneIds = WorldClockTimeZoneIds is { Count: > 0 }
|
|
? new List<string>(WorldClockTimeZoneIds)
|
|
: [];
|
|
|
|
return clone;
|
|
}
|
|
}
|