public static async Task <HohoemaUserSettings> LoadSettings(StorageFolder userFolder) { var ranking = await SettingsBase.Load <RankingSettings>(RankingSettingsFileName, userFolder); var playlist = await SettingsBase.Load <PlaylistSettings>(PlaylistSettingsFileName, userFolder); var ng = await SettingsBase.Load <NGSettings>(NGSettingsFileName, userFolder); var player = await SettingsBase.Load <PlayerSettings>(PlayerSettingsFileName, userFolder); var cache = await SettingsBase.Load <CacheSettings>(CacheSettingsFileName, userFolder); var appearance = await SettingsBase.Load <AppearanceSettings>(AppearanceSettingsFileName, userFolder); var nicorepoAndFeed = await SettingsBase.Load <ActivityFeedSettings>(NicoRepoAndFeedSettingsFileName, userFolder); var pin = await SettingsBase.Load <PinSettings>(PinSettingsFileName, userFolder); if (nicorepoAndFeed.DisplayNicoRepoItemTopics.Count == 0) { nicorepoAndFeed.DisplayNicoRepoItemTopics.AddRange(new [] { NicoRepoItemTopic.NicoVideo_User_Video_Upload, NicoRepoItemTopic.NicoVideo_User_Mylist_Add_Video, NicoRepoItemTopic.Live_Channel_Program_Onairs, NicoRepoItemTopic.Live_Channel_Program_Reserve, NicoRepoItemTopic.NicoVideo_Channel_Video_Upload, NicoRepoItemTopic.Live_User_Program_OnAirs, NicoRepoItemTopic.Live_User_Program_Reserve, }); } var settings = new HohoemaUserSettings() { RankingSettings = ranking, PlaylistSettings = playlist, NGSettings = ng, PlayerSettings = player, CacheSettings = cache, AppearanceSettings = appearance, ActivityFeedSettings = nicorepoAndFeed, PinSettings = pin, }; try { PinSettings.MigratePinParameter_Prism6_to_Prism7(pin); } catch { } settings.SetupSaveWithPropertyChanged(); return(settings); }
private HohoemaApp(IEventAggregator ea) { EventAggregator = ea; NiconicoContext = new NiconicoContext(); LoginUserId = uint.MaxValue; LoggingChannel = new LoggingChannel("HohoemaLog", new LoggingChannelOptions(HohoemaLoggerGroupGuid)); UserSettings = new HohoemaUserSettings(); ContentFinder = new NiconicoContentFinder(this); UserMylistManager = new UserMylistManager(this); OtherOwneredMylistManager = new OtherOwneredMylistManager(ContentFinder); FeedManager = new FeedManager(this); FollowManager = null; _SigninLock = new SemaphoreSlim(1, 1); BackgroundUpdater = new BackgroundUpdater("HohoemaBG", UIDispatcher); ApplicationData.Current.DataChanged += Current_DataChanged; UpdateServiceStatus(); NetworkInformation.NetworkStatusChanged += NetworkInformation_NetworkStatusChanged; }
private async Task LoadUserSettings() { var folder = ApplicationData.Current.LocalFolder; UserSettings = await HohoemaUserSettings.LoadSettings(folder); }