コード例 #1
0
        public VerseReference(int chapter, int verse)
        {
            this.Chapter = chapter;
            this.Verse   = verse;

            QuranStructure.ValidateChapterAndVerse(
                chapter: chapter,
                verse: verse
                );
        }
コード例 #2
0
ファイル: QuranStructure.cs プロジェクト: Arabicsource/QuranX
 public static void ValidateChapterAndVerse(int chapter, int verse)
 {
     if (chapter < 1 || chapter > 114)
     {
         throw new ArgumentOutOfRangeException("Chapter");
     }
     if (verse < 1 || verse > QuranStructure.VerseCount(chapter))
     {
         throw new ArgumentOutOfRangeException("Verse");
     }
 }
コード例 #3
0
        public VerseRangeReference(int chapter, int firstVerse, int lastVerse)
        {
            this.Chapter    = chapter;
            this.FirstVerse = firstVerse;
            this.LastVerse  = lastVerse;

            QuranStructure.ValidateChapterAndVerse(
                chapter: chapter,
                verse: firstVerse
                );
            QuranStructure.ValidateChapterAndVerse(
                chapter: chapter,
                verse: lastVerse
                );
        }