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

◆ ConvertFrom() [1/2]

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

Reimplemented from System.ComponentModel.TypeConverter.

Definition at line 26 of file TimeSpanConverter.cs.

27 {
28 if (value is string text)
29 {
30 string input = text.Trim();
31 try
32 {
33 return TimeSpan.Parse(input, culture);
34 }
35 catch (FormatException innerException)
36 {
37 throw new FormatException(System.SR.Format(System.SR.ConvertInvalidPrimitive, (string)value, "TimeSpan"), innerException);
38 }
39 }
40 return base.ConvertFrom(context, culture, value);
41 }
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.input, System.TimeSpan.Parse(), System.text, and System.value.