Exemplo n.º 1
0
 public Result Expect(out string val, string name)
 {
     if (Result.Good != Has(out val) || String.IsNullOrWhiteSpace(val))
     {
         Tell.MustProvideInput(name);
         return(Result.Invalid);
     }
     return(Result.Good);
 }
Exemplo n.º 2
0
        public Result Expect <T>(string @switch, out T val) where T : IConvertible
        {
            var has = Default(@switch, out val);

            if (Result.Good != has)
            {
                if (has == Result.Missing)
                {
                    Tell.MustProvideInput(@switch);
                }
                return(Result.Invalid);
            }
            return(Result.Good);
        }
Exemplo n.º 3
0
        public Result Expect(string @switch)
        {
            var has = Has(@switch);

            if (Result.Good != has)
            {
                if (has == Result.Missing)
                {
                    Tell.MustProvideInput(@switch);
                }
                return(Result.Invalid);
            }
            return(Result.Good);
        }