Class StringConstructorConverter<T>
Generic type converter for classes that have a constructor with a single string argument and a corresponding object.ToString() implementation.
public class StringConstructorConverter<T> : TypeConverter
Type Parameters
TThe type the converter is used for.
- Inheritance
-
objectStringConstructorConverter<T>
- Inherited Members
- Extension Methods
Examples
Add this attribute to the type:
[TypeConverter(typeof(StringConstructorConverter<NameOfType>))]
Constructors
StringConstructorConverter()
public StringConstructorConverter()
Methods
CanConvertFrom(ITypeDescriptorContext?, Type)
public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)
Parameters
contextITypeDescriptorContextsourceTypeType
Returns
ConvertFrom(ITypeDescriptorContext?, CultureInfo?, object)
public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)
Parameters
contextITypeDescriptorContextcultureCultureInfovalueobject
Returns
- object
ConvertTo(ITypeDescriptorContext?, CultureInfo?, object?, Type)
public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
Parameters
contextITypeDescriptorContextcultureCultureInfovalueobjectdestinationTypeType
Returns
- object