Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ConvertFrom() [1/2]

override? object System.ComponentModel.BooleanConverter.ConvertFrom ( ITypeDescriptorContext? context,
CultureInfo? culture,
object value )
inlinevirtual

Reimplemented from System.ComponentModel.TypeConverter.

Definition at line 18 of file BooleanConverter.cs.

19 {
20 if (value is string text)
21 {
22 string value2 = text.Trim();
23 try
24 {
25 return bool.Parse(value2);
26 }
27 catch (FormatException innerException)
28 {
29 throw new FormatException(System.SR.Format(System.SR.ConvertInvalidPrimitive, (string)value, "Boolean"), innerException);
30 }
31 }
32 return base.ConvertFrom(context, culture, value);
33 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string ConvertInvalidPrimitive
Definition SR.cs:20
Definition SR.cs:7

References System.SR.ConvertInvalidPrimitive, System.culture, System.SR.Format(), System.text, and System.value.