tModLoader v2024.03
A mod to make and play Terraria mods
ToFromStringConverter< T > Class Template Reference

This TypeConverter facilitates converting to and from the string Type. This is necessary for Objects that are to be used as Dictionary keys, since the JSON for keys needs to be a string. Classes annotated with this TypeConverter need to implement a static FromString method that returns T. More...

Inherits TypeConverter.

Public Member Functions

override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
 
override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
 
override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
 

Detailed Description

This TypeConverter facilitates converting to and from the string Type. This is necessary for Objects that are to be used as Dictionary keys, since the JSON for keys needs to be a string. Classes annotated with this TypeConverter need to implement a static FromString method that returns T.

Template Parameters
TThe Type that implements the static FromString method that returns Type T.