Exemplo n.º 1
0
        public IList <FeastDate> GetFeastsForYear(string year)
        {
            IList <FeastDate> feastsForYear = _databaseModel.GetFeastsForYear(year);

            if (feastsForYear.Count == 0)
            {
                // get feast name etc; NOT dates
                IList <FeastInfoObject> feasts = _databaseModel.GetFeasts();
                if (feasts.Count == 0)
                {
                    // not found, so load them from the json file
                    feasts = _databaseModel.SetFeasts(GetDominicanFeasts());
                }

                DominicanCalender dominicanCalender = FreshIOC.Container.Resolve <IDominicanCalender>() as DominicanCalender;

                // get the calender of dominican dates for that year
                DominicanSeason dominicanSeason = dominicanCalender.GetDominicanSeasonForYear(year);

                IList <FeastDateObject> feastDateObjects = CreateFeastsForYear(year, dominicanSeason);

                _databaseModel.SetFeastsForYear(year, feastDateObjects);
                feastsForYear = _databaseModel.GetFeastsForYear(year);

                if (_test)
                {
                    Debug.WriteLine($"{_Tag}.GetFeastForYear( {year} )");
                    foreach (FeastDate feastDate in feastsForYear)
                    {
                        Debug.WriteLine(feastDate.ToString());
                    }
                    Debug.WriteLine($"{_Tag}.GetFeastForYear( Fin )");
                }
            }

            return(feastsForYear);
        }
Exemplo n.º 2
0
 public PrayerModel()
 {
     _dominicanCalender = FreshIOC.Container.Resolve <IDominicanCalender>() as DominicanCalender;
 }