private static PrintingConfig <TOwner> UsingCultureForNumberType <TOwner, TPropType>(
            PropertyPrintingConfig <TOwner, TPropType> propConfig, CultureInfo cultureInfo)
        {
            var parentConfig = ((IPropertyPrintingConfig <TOwner>)propConfig).ParentConfig;

            ((IPrintingConfig)parentConfig).TypeCultures[typeof(TPropType)] = cultureInfo;
            return(parentConfig);
        }
        public static PrintingConfig <TOwner> TrimmedToLength <TOwner>(
            this PropertyPrintingConfig <TOwner, string> propConfig, int maxLen)
        {
            if (maxLen < 0)
            {
                throw new ArgumentException("MaxLen should be non-negative");
            }

            return(propConfig.Using(str =>
                                    str.Length > maxLen
                    ? str.Substring(0, maxLen)
                    : str));
        }
 public static PrintingConfig <TOwner> Using <TOwner>(this PropertyPrintingConfig <TOwner, decimal> propConfig,
                                                      CultureInfo cultureInfo)
 {
     return(UsingCultureForNumberType(propConfig, cultureInfo));
 }