using XFEExtension.NetCore.AutoConfig; using XFEExtension.NetCore.WinUIHelper.Utilities; using XFEExtension.NetCore.WinUIHelper.Utilities.Helper; using XFENewsApplication.Core.Models; using XFENewsApplication.Models; namespace XFENewsApplication.Profiles.CrossVersionProfiles; [AutoLoadProfile] 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 bool msnPersonalizationEnabled = true; /// /// 逗号分隔的新闻兴趣关键词 /// [ProfileProperty] private string msnInterests = 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; } } }