Table of Contents

Class StringConstructorConverter<T>

Namespace
NanoByte.Common.Values.Design
Assembly
NanoByte.Common.dll

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

T

The type the converter is used for.

Inheritance
object
StringConstructorConverter<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

context ITypeDescriptorContext
sourceType Type

Returns

bool

ConvertFrom(ITypeDescriptorContext?, CultureInfo?, object)

public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)

Parameters

context ITypeDescriptorContext
culture CultureInfo
value object

Returns

object

ConvertTo(ITypeDescriptorContext?, CultureInfo?, object?, Type)

public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)

Parameters

context ITypeDescriptorContext
culture CultureInfo
value object
destinationType Type

Returns

object