Wanzyee Studio
NumericStringConverter< T >abstract

Base class of custom BaseStringConverter for a simple type with numeric variables. More...

Inherits BaseStringConverter< T >.

Public Member Functions

override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
 Returns whether this converter can convert an object of one type to the type of this converter. More...
 
override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
 Returns whether this converter can convert the object to the specified type. More...
 
override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
 Converts the given value to the type of this converter. More...
 
override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
 Converts the given value object to the specified type. More...
 

Protected Member Functions

override T FromString (string value)
 Convert the value of string to target type. More...
 
abstract T FromFloats (float[] floats)
 Convert the value from float array to target type. More...
 
virtual string ToString (T value)
 Convert the value of target type to string. More...
 

Detailed Description

Base class of custom BaseStringConverter for a simple type with numeric variables.

Template Parameters
TThe value type.

Member Function Documentation

override T FromString ( string  value)
protectedvirtual

Convert the value of string to target type.

Parameters
valueThe string value.
Returns
The instance of target type.

Implements BaseStringConverter< T >.

abstract T FromFloats ( float[]  floats)
protectedpure virtual

Convert the value from float array to target type.

Parameters
floatsThe float array.
Returns
The instance of target type.

Implemented in ColorStringConverter, RectOffsetStringConverter, RectStringConverter, Vector2StringConverter, and Vector3StringConverter.

override bool CanConvertFrom ( ITypeDescriptorContext  context,
Type  sourceType 
)
inherited

Returns whether this converter can convert an object of one type to the type of this converter.

Parameters
contextAn ITypeDescriptorContext that provides a format context.
sourceTypeA Type that represents the type you want to convert from.
Returns
true if this converter can perform the conversion; otherwise, false.
override bool CanConvertTo ( ITypeDescriptorContext  context,
Type  destinationType 
)
inherited

Returns whether this converter can convert the object to the specified type.

Parameters
contextAn ITypeDescriptorContext that provides a format context.
destinationTypeA Type that represents the type you want to convert to.
Returns
true if this converter can perform the conversion; otherwise, false.
override object ConvertFrom ( ITypeDescriptorContext  context,
CultureInfo  culture,
object  value 
)
inherited

Converts the given value to the type of this converter.

Parameters
contextAn ITypeDescriptorContext that provides a format context.
cultureThe CultureInfo to use as the current culture.
valueThe object to convert.
Returns
An object that represents the converted value.
override object ConvertTo ( ITypeDescriptorContext  context,
CultureInfo  culture,
object  value,
Type  destinationType 
)
inherited

Converts the given value object to the specified type.

Parameters
contextAn ITypeDescriptorContext that provides a format context.
cultureThe CultureInfo to use as the current culture.
valueThe object to convert.
destinationTypeThe Type to convert the value parameter to.
Returns
An object that represents the converted value.
virtual string ToString ( value)
protectedvirtualinherited

Convert the value of target type to string.

Parameters
valueThe target type value.
Returns
The string.