示例#1
0
 void AddHadithToIndividualVerses(Hadith hadith)
 {
     foreach (var verseRangeReference in hadith.VerseReferences)
     {
         for (int verseIndex = verseRangeReference.FirstVerse;
              verseIndex <= verseRangeReference.LastVerse;
              verseIndex++
              )
         {
             List <Hadith> hadiths;
             var           verseReference = new VerseReference(
                 chapter: verseRangeReference.Chapter,
                 verse: verseIndex
                 );
             if (!HadithsByVerse.TryGetValue(verseReference, out hadiths))
             {
                 hadiths = new List <Hadith>();
                 HadithsByVerse[verseReference] = hadiths;
             }
             hadiths.Add(hadith);
         }
     }
 }
示例#2
0
 public CollectionAndHadith(HadithCollection collection, Hadith hadith)
 {
     this.Collection = collection;
     this.Hadith     = hadith;
 }
示例#3
0
 protected virtual void VisitHadith(Hadith hadith)
 {
 }
示例#4
0
 public void AddHadith(Hadith hadith)
 {
     _Hadiths.Add(hadith);
     AddHadithToIndividualVerses(hadith);
 }