Esempio n. 1
0
 public MinValue(IArgument <T> target, T minValue)
 {
     Target         = target;
     MinVal         = minValue;
     _lazyMakeValid = new misc.Lazy <IEnumerable <ISolution <IParserResult> > >(
         () => new ReadOnlyCollection <ISolution <IParserResult> >(
             new List <ISolution <IParserResult> > {
         new Solution <IParserResult>(
             new[] {
             new SetValue <T>(target, minValue)
         }),
         new Solution <IParserResult>(
             new[] {
             new PromptValue <T>(target)
         })
     }));
     _lazyMakeInvalid = new misc.Lazy <IEnumerable <ISolution <IParserResult> > >(
         () => new ReadOnlyCollection <ISolution <IParserResult> >(
             new List <ISolution <IParserResult> > {
         new Solution <IParserResult>(
             new[] {
             new SetValue <T>(
                 target,
                 SetValue <T> .Sub(minValue, (T)Convert.ChangeType(1, typeof(T))))
         })
     }));
 }