tModLoader v2022.09
A mod to make and play Terraria mods
Terraria.ModLoader.Config.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 implementes the static FromString method that returns Type T.