コード例 #1
0
 public IStringParser <bool> GetBoolParser(BoolFormatType formatType)
 {
     return(boolcache.GetOrAdd(formatType, new Lazy <IStringParser <bool> >(() =>
     {
         var tf = formatType.GetValue();
         return new CustomFormatBoolStringParser(tf.Item1, tf.Item2);
     })
                               ).Value);
 }
コード例 #2
0
        public static Tuple <string[], string[]> GetValue(this BoolFormatType formatType)
        {
            switch (formatType)
            {
            case BoolFormatType.YesOrNo: return(Tuple.Create(new string[] { "Yes" }, new string[] { "No" }));

            case BoolFormatType.YorN: return(Tuple.Create(new string[] { "Y" }, new string[] { "N" }));
            }

            throw new Exception("TODO");
        }
コード例 #3
0
 public ITypeConverter GetBoolTypeConverter(BoolFormatType formatType)
 {
     return(new TypeConverterImpl(repo.GetBoolParser(formatType)));
 }