9 namespace Core.TypeCast
12 using System.Globalization;
24 private bool converterDefaultWrapperOrException;
29 private bool useFunctionDefaultWrapper;
48 NumberFormatInfo numberFormat = null,
49 bool defaultValueAnyType =
false,
50 bool useFunctionDefaultWrapper =
true,
51 bool converterMissingException =
false,
52 bool converterClassExistsException =
false,
53 bool autoInitialize =
true,
54 bool allowGenericTypes =
true,
55 bool allowExplicitObject =
true,
56 bool allowDynamicType =
true,
57 bool converterDefaultWrapperOrException =
true,
58 int boundedCapacity = 10000)
60 this.DefaultValueAnyType = defaultValueAnyType;
61 this.UseFunctionDefaultWrapper = useFunctionDefaultWrapper;
62 this.NumberFormat = numberFormat ?? DefaultNumberFormat;
63 this.ConverterMissingException = converterMissingException;
64 this.ConverterClassExistsException = converterClassExistsException;
65 this.AutoInitialize = autoInitialize;
66 this.AllowGenericTypes = allowGenericTypes;
67 this.AllowExplicitObject = allowExplicitObject;
68 this.AllowDynamicType = allowDynamicType;
69 this.ConverterDefaultWrapperOrException = converterDefaultWrapperOrException;
70 this.BoundedCapacity = boundedCapacity;
76 public static NumberFormatInfo DefaultNumberFormat {
get;
set; } =
new NumberFormatInfo { NumberGroupSeparator =
".", NumberDecimalDigits = 2 };
81 public bool AllowGenericTypes {
get;
set; }
86 public bool AllowExplicitObject {
get;
set; }
93 public bool AllowDynamicType {
get;
set; }
98 public bool AutoInitialize {
get;
set; }
104 public int BoundedCapacity {
get;
set; }
109 public bool ConverterDefaultWrapperOrException
113 return this.converterDefaultWrapperOrException;
118 this.useFunctionDefaultWrapper = value;
119 this.converterDefaultWrapperOrException = !value;
126 public bool ConverterMissingException {
get;
set; }
131 public bool ConverterClassExistsException {
get;
set; }
140 public bool DefaultValueAnyType {
get;
set; }
145 public NumberFormatInfo NumberFormat {
get;
set; }
150 public bool UseFunctionDefaultWrapper
154 return this.useFunctionDefaultWrapper;
159 this.useFunctionDefaultWrapper = value;
160 this.converterDefaultWrapperOrException = !value;
ConverterCollectionSettings(NumberFormatInfo numberFormat=null, bool defaultValueAnyType=false, bool useFunctionDefaultWrapper=true, bool converterMissingException=false, bool converterClassExistsException=false, bool autoInitialize=true, bool allowGenericTypes=true, bool allowExplicitObject=true, bool allowDynamicType=true, bool converterDefaultWrapperOrException=true, int boundedCapacity=10000)
Initializes a new instance of the ConverterCollectionSettings class.
The settings for the ConverterCollection.