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

◆ ConvertTo() [2/3]

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

Reimplemented from System.ComponentModel.TypeConverter.

Definition at line 75 of file ReferenceConverter.cs.

76 {
77 if (destinationType == typeof(string))
78 {
79 if (value != null)
80 {
82 {
83 string name = referenceService.GetName(value);
84 if (name != null)
85 {
86 return name;
87 }
88 }
89 if (!Marshal.IsComObject(value) && value is IComponent component)
90 {
91 string text = component.Site?.Name;
92 if (text != null)
93 {
94 return text;
95 }
96 }
97 return string.Empty;
98 }
99 return s_none;
100 }
101 return base.ConvertTo(context, culture, value, destinationType);
102 }
static bool IsComObject(object o)
Definition Marshal.cs:353

References System.culture, System.Runtime.InteropServices.Marshal.IsComObject(), System.ComponentModel.ReferenceConverter.s_none, System.text, and System.value.