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); }
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"); }
public ITypeConverter GetBoolTypeConverter(BoolFormatType formatType) { return(new TypeConverterImpl(repo.GetBoolParser(formatType))); }