public static PrintingConfig <TOwner> Using <TOwner>(this PropertyPrintingConfig <TOwner, long> propConfig,
                                                      CultureInfo cultureInfo)
 {
     ((IPrintingConfig <TOwner>)((IPropertyPrintingConfig <TOwner, long>)propConfig).ParentConfig)
     .AddTypeCulture(typeof(long), cultureInfo);
     return(((IPropertyPrintingConfig <TOwner, long>)propConfig).ParentConfig);
 }
        public static PrintingConfig <TOwner> TrimmedToLength <TOwner>(this PropertyPrintingConfig <TOwner, string> propConfig,
                                                                       int maxLen)
        {
            IPropertyPrintingConfig <TOwner, string> propertyConfig = propConfig;

            if (string.IsNullOrWhiteSpace(propertyConfig.PropName))
            {
                ((IPrintingConfig <TOwner>)propertyConfig.ParentConfig).SetAverageStringLength(maxLen);
            }
            else
            {
                ((IPrintingConfig <TOwner>)propertyConfig.ParentConfig).SetStringPropertyLength(propertyConfig.PropName, maxLen);
            }

            return(((IPropertyPrintingConfig <TOwner, string>)propConfig).ParentConfig);
        }
Exemplo n.º 3
0
 public static PrintingConfig <TOwner> Using <TOwner>(this PropertyPrintingConfig <TOwner, float> propConfig, CultureInfo cultureInfo)
 {
     return(((IPropertyPrintingConfig <TOwner, float>)propConfig).ParentConfig);
 }
Exemplo n.º 4
0
 public static PrintingConfig <TOwner> TrimmedToLength <TOwner>(this PropertyPrintingConfig <TOwner, string> propConfig, int maxLen)
 {
     return(((IPropertyPrintingConfig <TOwner, string>)propConfig).ParentConfig);
 }
 public static PrintingConfig <TOwner> TrimmedToLength <TOwner>(
     this PropertyPrintingConfig <TOwner, string> propConfig, int maxLen)
 {
     propConfig.Using(s => s[0..Math.Min(s.Length, maxLen)]);
Exemplo n.º 6
0
 public static PrintingConfig <TOwner> TrimmedToLength <TOwner>
     (this PropertyPrintingConfig <TOwner, string> propConfig, int maxLen)
 {
     return(propConfig.Using(str => maxLen > str.Length ? str : str.Substring(0, maxLen)));
 }