Example #1
0
        public TriodionRule FindTriodionRule(int daysFromEaster)
        {
            TriodionRule result = (TriodionRule)ChildElements.AsQueryable().
                                  FirstOrDefault(c => ((c is TriodionRule) && ((c as TriodionRule).Day.DaysFromEaster == daysFromEaster)));

            if (result == null)
            {
                foreach (TypiconFolder folder in Folders)
                {
                    result = folder.FindTriodionRule(daysFromEaster);
                    if (result != null)
                    {
                        return(result);
                    }
                }
            }

            return(result);
        }
Example #2
0
        public Day FindDay(Expression <Func <Day, bool> > predicate)
        {
            if (predicate == null)
            {
                return(null);
            }

            Day result = ChildElements.AsQueryable().Where(predicate).FirstOrDefault();

            if (result == null)
            {
                foreach (DayFolder folder in Folders)
                {
                    result = folder.FindDay(predicate);
                    if (result != null)
                    {
                        return(result);
                    }
                }
            }

            return(result);
        }