Ejemplo n.º 1
0
        private static IEnumerable <VerseRangeReference> AddSurroundingVerses(int?context, VerseRangeReference firstReference)
        {
            IEnumerable <VerseRangeReference> verseRangeReferences;
            int numberOfVerses    = QuranStructure.Chapter(firstReference.Chapter).NumberOfVerses;
            int firstVerse        = Math.Max(1, firstReference.FirstVerse - context.Value);
            int lastVerse         = Math.Min(numberOfVerses, firstReference.LastVerse + context.Value);
            var newVerseReference = new VerseRangeReference(
                chapter: firstReference.Chapter,
                firstVerse: firstVerse,
                lastVerse: lastVerse);

            verseRangeReferences = new[] { newVerseReference };
            return(verseRangeReferences);
        }
Ejemplo n.º 2
0
 public Chapter Get(int chapterNumber) => QuranStructure.Chapter(chapterNumber);