private void Init() { this.tbIntro.Text = OkrBookContext.Current.Config.Intro; IsolatedStorageSettings.ApplicationSettings.TryGetValue<BookSetting>("set", out this.set); if (this.set == null) { this.set = new BookSetting(); IsolatedStorageSettings.ApplicationSettings["set"] = this.set; IsolatedStorageSettings.ApplicationSettings.Save(); } this.tsRemind.IsChecked = this.set.IsNightMode; this.tbRemind.Text = this.set.IsNightMode ? "开启" : "关闭"; this.tbIntro.Foreground = this.set.IsNightMode ? OkrBookConfig.WBrush : OkrBookConfig.BBrush; FontSet(this.set.FontSize); }
public Viewer() { this.flag = OkrBookConfig.Flag; this.fontsize = OkrBookConfig.FontSize; this.lineHeight = OkrBookConfig.LineHeight; this.bookHeight = OkrBookConfig.BookHeight; this.height = OkrBookConfig.Height; this.InitializeComponent(); IsolatedStorageSettings.ApplicationSettings.TryGetValue<Book>("bookinfo", out this.book); IsolatedStorageSettings.ApplicationSettings.TryGetValue<Progress>("current", out this.progress); this.currentChapter = this.progress.Chapter; IsolatedStorageSettings.ApplicationSettings.TryGetValue<Mark>("marks", out this.mark); if (this.mark == null) { this.mark = new Mark(); IsolatedStorageSettings.ApplicationSettings["marks"] = this.mark; IsolatedStorageSettings.ApplicationSettings.Save(); } IsolatedStorageSettings.ApplicationSettings.TryGetValue<BookSetting>("set", out this.set); if (this.set == null) { this.set = new BookSetting(); IsolatedStorageSettings.ApplicationSettings["set"] = this.set; IsolatedStorageSettings.ApplicationSettings.Save(); } this.fontsize = this.set.FontSize; ThemeInit(); //this.fontColor = OkrBookConfig.WhiteBrush; // if (OkrBookContext.Current.App.Ad.IsShow) //启用网络判断,非常的慢,&& AtNetwork.IsNetworkAvailable() { this.bookHeight = OkrBookConfig.AdBookHeight; this.height = OkrBookConfig.AdHeight; // 720; } this.Init(); base.Loaded += new RoutedEventHandler(OnLoad); this.Showtime(); }