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)); }
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)); }
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); }
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); }
public Quran() { Type = QuranType.Normal; Suwar = new Dictionary <int, Surah>(); }