public bool ListChapters(BibleSearchMatch sm) { this.CChapters.Items.Clear(); if (sm == null) { return(false); } BibleBook bk = null; if (!BibleStore.BibleStore.EngBible.Books.TryGetValue(sm.BookId.ToLower(), out bk)) { return(false); } for (var cn = 0; cn < bk.Chapters.Count; cn++) { var res = BibleStore.BibleStore.FindEn(string.Format($"{sm.BookName} {(cn+1).ToString()}")); if (res.Matches.Length < 1) { continue; } var match = res.Matches[0]; this.CChapters.Items.Add(CreateItem(match, match.Verses.First())); } this.CChapters.SelectedItem = null; return(false); }
public ListBoxItem CreateItem(BibleSearchMatch match, BibleSearchVerse verse) { return(new ListBoxItem() { BorderThickness = new Thickness(0.0, 1.0, 0.0, 0.0), BorderBrush = (Brush)Brushes.Gray, Tag = match.Clone(verse), Content = CreateEntry(match, verse) }); }
public VerseEntry CreateEntry(BibleSearchMatch match, BibleSearchVerse verse) { VerseEntry verseEntry = new VerseEntry(); string name = string.Format("{0} {1} {2}:{3}", match.BookNames["zh"], match.BookNames["en"], match.Chapter.ToString(), verse.Verse.ToString()); //verseEntry.Search = string.Format("{0} {1}:{2}", (object) book.Name, (object) chp, (object) verse); verseEntry.SetContent(name, verse.Content["en"], verse.Content["zh"]); return(verseEntry); }
public bool RefreshVerses(BibleSearchMatch match) { this.CVerses.Items.Clear(); foreach (var vs in match.Verses) { this.CVerses.Items.Add(CreateItem(match, vs)); } return(false); }
public void SetContent(BibleSearchMatch entry) { this.CName.Content = string.Format($"{entry.BookNames["zh"]} {entry.BookNames["en"]} {entry.Chapter.ToString()}:{entry.SelectedVerse.Verse.ToString()}"); this.CText.Text = entry.SelectedVerse.Content["en"]; this.CText2.Text = entry.SelectedVerse.Content["zh"]; this.RefreshContent(); if (!this.IsVisible) { return; } this.SelfAdjust(); TraceLogger.Send("Set Content Self Adjust"); }
private void ShowEntry(BibleSearchMatch ve) => this.mDisplay.SetContent(ve);
public bool RefreshChapters(BibleSearchMatch match) { this.CChapters.Items.Clear(); this.CChapters.Items.Add(CreateItem(match, match.Verses.First())); return(false); }