示例#1
0
 public EachNode(int id, TokenValueFactory <T, TProperty> tokenValue,
                 Action <TProperty, Action <TElement, int> > elementMatch)
     : base(id)
 {
     _tokenValue   = tokenValue;
     _elementMatch = elementMatch;
 }
        public static ExistsNode <T, TProperty> Exists <T, TProperty>(this RuntimeConfigurator configurator)
            where T : class
            where TProperty : class, IEnumerable
        {
            TokenValueFactory <T, TProperty> tokenValue = Conditionals.Property <T, TProperty>();

            return(configurator.CreateNode(id => new ExistsNode <T, TProperty>(id, tokenValue)));
        }
        public static NotNullNode <T, TProperty> NotNull <T, TProperty>(this RuntimeConfigurator configurator)
            where T : class
            where TProperty : class
        {
            TokenValueFactory <T, TProperty> tokenValue = Conditionals.Property <T, TProperty>();

            return(configurator.CreateNode(id => new NotNullNode <T, TProperty>(id, tokenValue)));
        }
示例#4
0
        public static CompareNode <T, TProperty> Compare <T, TProperty>(this RuntimeConfigurator configurator,
                                                                        Comparator <TProperty, TProperty> comparator,
                                                                        Value <TProperty> value)
            where T : class
        {
            TokenValueFactory <T, TProperty> tokenValue = Conditionals.Property <T, TProperty>();

            return(configurator.CreateNode(id => new CompareNode <T, TProperty>(id, tokenValue, comparator, value)));
        }
        public static EachNode <T, TProperty, TElement> Each <T, TProperty, TElement>(
            this RuntimeConfigurator configurator,
            Action <TProperty, Action <TElement, int> > elementMatch)
            where T : class
            where TProperty : class, IEnumerable
        {
            TokenValueFactory <T, TProperty> tokenValue = Conditionals.Property <T, TProperty>();

            return(configurator.CreateNode(id => new EachNode <T, TProperty, TElement>(id, tokenValue, elementMatch)));
        }
示例#6
0
 public CompareNode(int id,
                    TokenValueFactory <T, TProperty> tokenValue,
                    Comparator <TProperty, TProperty> comparator,
                    Value <TProperty> value)
     : base(id)
 {
     _tokenValue = tokenValue;
     _comparator = comparator;
     _value      = value;
 }
        public static CompareNode <T, TProperty> LessThanOrEqual <T, TProperty>(this RuntimeConfigurator configurator,
                                                                                TProperty value)
            where T : class
            where TProperty : IComparable <TProperty>
        {
            Value <TProperty> rightValue = Conditional.Constant(value);
            TokenValueFactory <T, TProperty> tokenValue = Conditional.Property <T, TProperty>();

            var comparator = new LessThanOrEqualValueComparator <TProperty>();

            return(configurator.CreateNode(id => new CompareNode <T, TProperty>(id, tokenValue, comparator, rightValue)));
        }
示例#8
0
 public NotNullNode(int id, TokenValueFactory <T, TProperty> tokenValue)
     : base(id)
 {
     _tokenValue = tokenValue;
 }
示例#9
0
 public ExistsNode(int id, TokenValueFactory <T, TProperty> tokenValue)
     : base(id)
 {
     _tokenValue = tokenValue;
 }