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

◆ ConvertFrom() [1/2]

override? object System.ComponentModel.ReferenceConverter.ConvertFrom ( ITypeDescriptorContext? context,
CultureInfo? culture,
object value )
inlinevirtualinherited

Reimplemented from System.ComponentModel.TypeConverter.

Definition at line 45 of file ReferenceConverter.cs.

46 {
47 if (value is string text)
48 {
49 string text2 = text.Trim();
50 if (!string.Equals(text2, s_none) && context != null)
51 {
53 {
54 object reference = referenceService.GetReference(text2);
55 if (reference != null)
56 {
57 return reference;
58 }
59 }
60 IContainer container = context.Container;
61 if (container != null)
62 {
63 object obj = container.Components[text2];
64 if (obj != null)
65 {
66 return obj;
67 }
68 }
69 }
70 return null;
71 }
72 return base.ConvertFrom(context, culture, value);
73 }

References System.ComponentModel.IContainer.Components, System.ComponentModel.ITypeDescriptorContext.Container, System.culture, System.IServiceProvider.GetService(), System.obj, System.ComponentModel.ReferenceConverter.s_none, System.text, and System.value.