Пример #1
0
 public Surah Clone(QuranType type)
 {
     if (type == QuranType.Concurrent)
     {
         return(new ConcurrentSurah(Index, EN_Name, AR_Name, Bismillah, Juz, Ayaat));
     }
     return(new Surah(Index, EN_Name, AR_Name, Bismillah, Juz, Ayaat));
 }
Пример #2
0
        public static Quran FromCustomXML(string xmlpath, QuranType type)
        {
            SerializableQuran serializable;

            //Derserialize
            System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(SerializableQuran));
            using (System.IO.FileStream stream = new System.IO.FileStream(xmlpath, System.IO.FileMode.Open, System.IO.FileAccess.Read))
            {
                serializable = (SerializableQuran)serializer.Deserialize(stream);
            }
            return(serializable.ConvertToQuran(type));
        }
Пример #3
0
        public Quran ConvertToQuran(QuranType type)
        {
            Quran quran = null;

            if (type == QuranType.Concurrent)
            {
                quran = new ConcurrentQuran();
            }
            else
            {
                quran = new Quran();
            }

            foreach (SerializableSurah surah in Suwar)
            {
                quran.Suwar[surah.Index] = surah.ConvertToSurah(type);
            }
            return(quran);
        }
Пример #4
0
        public Surah ConvertToSurah(QuranType type)
        {
            Surah s = new Surah(Index, EN_Name, AR_Name, Bismillah, Juz);

            if (type == QuranType.Concurrent)
            {
                s.Ayaat = new ConcurrentDictionary <int, Ayat>();
            }
            else
            {
                s.Ayaat = new Dictionary <int, Ayat>();
            }

            foreach (Ayat ayat in Ayaat)
            {
                s.Ayaat[ayat.Index] = ayat;
            }

            return(s);
        }
Пример #5
0
 public Quran()
 {
     Type  = QuranType.Normal;
     Suwar = new Dictionary <int, Surah>();
 }