コード例 #1
0
ファイル: RulesHelper.cs プロジェクト: wyt3dr4g0n/WheelMUD
        public static M MustBeBetween <M, T, R>(this IMustPassRule <M, T, R> mpr, R greaterThan, Expression <Func <T, R> > lessThan)
            where R : IComparable <R>
        {
            BetweenRuleBoundsOption   bounds          = DefaultBoundOption;
            Expression <Func <T, R> > greaterThanFunc = f => greaterThan;
            Expression <Func <T, R> > lessThanFunc    = lessThan;

            return(MustBeBetween(mpr, greaterThanFunc, lessThanFunc, bounds));
        }
コード例 #2
0
 public BetweenRule(Expression <Func <T, R> > value, Expression <Func <T, R> > greaterThan, Expression <Func <T, R> > lessThan, BetweenRuleBoundsOption options)
 {
     if (lessThan == null)
     {
         throw new ArgumentNullException("lessThan");
     }
     if (greaterThan == null)
     {
         throw new ArgumentNullException("greaterThan");
     }
     if (value == null)
     {
         throw new ArgumentNullException("value");
     }
     _value       = value.Compile();
     _greaterThan = greaterThan.Compile();
     _lessThan    = lessThan.Compile();
     _options     = options;
     Initialize();
 }
コード例 #3
0
ファイル: BetweenRule.cs プロジェクト: jvoeller0129/WheelMUD
 public BetweenRule(Expression <Func <T, R> > value, Expression <Func <T, R> > greaterThan, Expression <Func <T, R> > lessThan, BetweenRuleBoundsOption options)
 {
     this.value       = value.Compile();
     this.greaterThan = greaterThan.Compile();
     this.lessThan    = lessThan.Compile();
     this.options     = options;
     Initialize();
 }
コード例 #4
0
 public static M MustBeBetween <M, T, R>(this IMustPassRule <M, T, R> mpr, Expression <Func <T, R> > greaterThan, Expression <Func <T, R> > lessThan, BetweenRuleBoundsOption bounds)
     where R : IComparable <R>
 {
     return(mpr.MustPassRule(new BetweenRule <T, R>(mpr.Expression, greaterThan, lessThan, bounds)));
 }