Пример #1
0
        public static Condition AllAncestors(Condition c)
        {
            if (c == null)
            {
                throw new ArgumentNullException(nameof(c));
            }

            var recurse = new RecursiveCondition();

            recurse %= Parent(c & (recurse | NoParentExists));
            return(recurse);
        }
Пример #2
0
        public static Condition AnyAncestor(Condition c, Condition stopCondition)
        {
            if (c == null)
            {
                throw new ArgumentNullException(nameof(c));
            }
            if (stopCondition == null)
            {
                throw new ArgumentNullException(nameof(stopCondition));
            }

            var recurse = new RecursiveCondition();

            recurse %= Parent(~stopCondition & (c | recurse));
            return(recurse);
        }