private void MainWindow_Closing(object sender, CancelEventArgs e) { try { UserPreferenceModel preference = GlobalResources.UserPreferences; this.SetFont(preference.Font); this.SetFontSize(preference.FontSize); string biblesKey = ((Reader.Reader) this.uxMainTab.Items[0]).SelectedVerseKey; if (!Formatters.IsBiblesKey(biblesKey)) { int biblesId = ((Reader.Reader) this.uxMainTab.Items[0]).Bible.BibleId; biblesKey = Formatters.ChangeBible(biblesKey, biblesId); } preference.LastReadVerse = biblesKey; BiblesData.Database.InsertPreference(preference); } catch (Exception err) { // DO NOTHING } }
public void LoadReader(int bibleId, string verseKey) { Reader.Reader reader = this.CreateReader(true); this.uxMainTab.Items.Add(reader); reader.SetBible(bibleId); if (!verseKey.IsNullEmptyOrWhiteSpace()) { string bibleKey = Formatters.ChangeBible(verseKey, bibleId); reader.SetChapter(bibleKey); reader.SetVerse(bibleKey); } }