public Tafsir_Commentary(string tafsirCode, int chapter, int verse) { QuranVerseHelper.Clip( chapter: ref chapter, verse: ref verse ); this.Tafsir = SharedData.Document.TafsirDocument[tafsirCode]; this.Chapter = SharedData.Document.QuranDocument[chapter]; this.Verse = verse; this.Commentary = Tafsir.CommentaryForVerse(chapter, verse); }
void ReadCommentary(int chapterIndex, XElement commentaryNode) { int firstVerse = int.Parse(commentaryNode.Element("firstVerse").Value); int lastVerse = int.Parse(commentaryNode.Element("lastVerse").Value); var verseRangeReference = new VerseRangeReference( chapter: chapterIndex, firstVerse: firstVerse, lastVerse: lastVerse ); var text = commentaryNode.Elements("text").Select(x => x.Value); var comment = new TafsirComment( verseReference: verseRangeReference, text: text ); Tafsir.AddComment(comment); }