using XFEExtension.NetCore.AutoConfig; using XFEExtension.NetCore.WinUIHelper.Utilities; using XFENewsApplication.Core.Models; using XFENewsApplication.Models; namespace XFENewsApplication.Profiles.CrossVersionProfiles; public partial class UserProfile : XFEProfile { public UserProfile() => ProfilePath = $@"{AppPathHelper.LocalProfile}\{nameof(UserProfile)}"; /// /// 历史记录储存数量 /// [ProfileProperty] private int historyKeepCount = 100; /// /// MSN新闻的当前用户ID /// [ProfileProperty] private string msnUserId = string.Empty; /// /// 历史记录存储模式 /// [ProfileProperty] private HistorySaveMode historySaveMode = HistorySaveMode.OneHundred; /// /// 收藏的文章 /// [ProfileProperty] private LinkedList
favoriteArticleList = []; /// /// 历史记录 /// [ProfileProperty] [ProfilePropertyAddGet("Current.historyArticleList.CurrentProfile = Current")] [ProfilePropertyAddGet("return Current.historyArticleList")] private ProfileList historyArticleList = []; static partial void SetHistorySaveModeProperty(ref HistorySaveMode value) { switch (value) { case HistorySaveMode.OneHundred: HistoryKeepCount = 100; break; case HistorySaveMode.OneThousand: HistoryKeepCount = 1000; break; case HistorySaveMode.Unlimited: HistoryKeepCount = int.MaxValue; break; default: break; } } }