Exemple #1
0
 public void AddHadith(Hadith hadith)
 {
     if (_Hadiths.ContainsKey(hadith.Reference))
     {
         System.Console.WriteLine("Duplicate hadith reference " + Code + " " + hadith.Reference.ToString());
         return;
     }
     _Hadiths.Add(hadith.Reference, hadith);
     AddHadithToIndividualVerses(hadith);
 }
Exemple #2
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);
         }
     }
 }
Exemple #3
0
 public void AddHadith(Hadith hadith)
 {
     _Hadiths.Add(hadith);
     AddHadithToIndividualVerses(hadith);
 }
 protected virtual void VisitHadith(Hadith hadith)
 {
 }
 public CollectionAndHadith(HadithCollection collection, Hadith hadith)
 {
     this.Collection = collection;
     this.Hadith     = hadith;
 }