Ejemplo n.º 1
0
        public Calculator(CalculationMethods m, AsrJuristics a, HighLatitudeMethods h)
        {
            _calcMethod = MethodFactory.Build(m);

            InitSettings(a, h);

            InitOffsets();
        }
Ejemplo n.º 2
0
        private void InitSettings(AsrJuristics a, HighLatitudeMethods h)
        {
            _settings = new Setting
                            {
                                Imsak = Defaults.IMSAK_MINUTE,
                                IsImsakInMinutes = true,
                                DhuhurInMinutes = Defaults.DHUHUR_MINUTE,
                                AsrJuristic = a,
                                HighLatitudeMethod = h
                            };

            // from calc param
            _settings.Fajr = _calcMethod.Params.Fajr;

            _settings.Magrib = _calcMethod.Params.Magrib;
            _settings.IsMagribInMinutes = _calcMethod.Params.IsMagribInMinutes;

            _settings.Isha = _calcMethod.Params.Isha;
            _settings.IsIshaInMinutes = _calcMethod.Params.IsIshaInMinutes;

            _settings.Midnight = _calcMethod.Params.Midnight;

            _timeFormat = Defaults.TIME_FORMAT;
        }
Ejemplo n.º 3
0
 private static int AsrFactor(AsrJuristics asrJuristic)
 {
     return asrJuristic == AsrJuristics.Hanafi ? 2 : 1;
 }
Ejemplo n.º 4
0
        private void loadSettings()
        {
            if (AppSettings.loadSettings("countryFullName") != null)
                App.countryFullName = Convert.ToString(AppSettings.loadSettings("countryFullName"));

            if (AppSettings.loadSettings("ln") != null)
                App.ln = Convert.ToDouble(AppSettings.loadSettings("ln"));

            if (AppSettings.loadSettings("lt") != null)
                App.lt = Convert.ToDouble(AppSettings.loadSettings("lt"));

            if (AppSettings.loadSettings("backgroundImage") != null)
                App.backgroundImage = Convert.ToString(AppSettings.loadSettings("backgroundImage"));

            if (AppSettings.loadSettings("fajrNotification") != null)
                App.fajrNotification = Convert.ToInt32(AppSettings.loadSettings("fajrNotification"));

            if (AppSettings.loadSettings("dhuhrNotification") != null)
                App.dhuhrNotification = Convert.ToInt16(AppSettings.loadSettings("dhuhrNotification"));

            if (AppSettings.loadSettings("asrNotification") != null)
                App.asrNotification = Convert.ToInt16(AppSettings.loadSettings("asrNotification"));

            if (AppSettings.loadSettings("maghribNotification") != null)
                App.maghribNotification = Convert.ToInt16(AppSettings.loadSettings("maghribNotification"));

            if (AppSettings.loadSettings("ishaNotification") != null)
                App.ishaNotification = Convert.ToInt16(AppSettings.loadSettings("ishaNotification"));

            if (AppSettings.loadSettings("fajrAdjustment") != null)
                App.fajrAdjustment = Convert.ToDouble(AppSettings.loadSettings("fajrAdjustment"));

            if (AppSettings.loadSettings("dhuhrAdjustment") != null)
                App.dhuhrAdjustment = Convert.ToDouble(AppSettings.loadSettings("dhuhrAdjustment"));

            if (AppSettings.loadSettings("asrAdjustment") != null)
                App.asrAdjustment = Convert.ToDouble(AppSettings.loadSettings("asrAdjustment"));

            if (AppSettings.loadSettings("maghribAdjustment") != null)
                App.maghribAdjustment = Convert.ToDouble(AppSettings.loadSettings("maghribAdjustment"));

            if (AppSettings.loadSettings("ishaAdjustment") != null)
                App.ishaAdjustment = Convert.ToDouble(AppSettings.loadSettings("ishaAdjustment"));

            if (AppSettings.loadSettings("isDST") != null)
                App.isDST = Convert.ToBoolean(Convert.ToInt16(AppSettings.loadSettings("isDST")));

            if (AppSettings.loadSettings("timeZone") != null)
                App.timeZone = Convert.ToInt32(Convert.ToInt16(AppSettings.loadSettings("timeZone")));

            if (AppSettings.loadSettings("timeZoneSelectedIndex") != null)
                App.timeZone = Convert.ToInt32(Convert.ToInt16(AppSettings.loadSettings("timeZoneSelectedIndex")));

            if (AppSettings.loadSettings("displayTimeFormat") != null)
                App.displayTimeFormat = (TimeFormats)Enum.Parse(typeof(TimeFormats), AppSettings.loadSettings("displayTimeFormat"));

            if (AppSettings.loadSettings("cm") != null)
                App.cm = (CalculationMethods)Enum.Parse(typeof(CalculationMethods), AppSettings.loadSettings("cm"));

            if (AppSettings.loadSettings("hlm") != null)
                App.hlm = (HighLatitudeMethods)Enum.Parse(typeof(HighLatitudeMethods), AppSettings.loadSettings("hlm"));

            if (AppSettings.loadSettings("aj") != null)
                App.aj = (AsrJuristics)Enum.Parse(typeof(AsrJuristics), AppSettings.loadSettings("aj"));

            if (AppSettings.loadSettings("translationLanguage") != null)
                App.translationLanguage = AppSettings.loadSettings("translationLanguage");

            if (AppSettings.loadSettings("quranChapterNameLang") != null)
                App.quranChapterNameLang = Convert.ToInt16(AppSettings.loadSettings("quranChapterNameLang"));

            if (AppSettings.loadSettings("quranReadingBookmark") != null)
                App.quranReadingBookmark = AppSettings.loadSettings("quranReadingBookmark");

            if (AppSettings.loadSettings("scheduleFactorySetupDate") == null)
                App.scheduleFactorySetupDate = new DateTime().Date.AddYears(-1);
            else
                App.scheduleFactorySetupDate = Convert.ToDateTime(AppSettings.loadSettings("scheduleFactorySetupDate"));
        }