C# Class Spring.Core.TypeConversion.RuntimeTypeConverter

A custom System.ComponentModel.TypeConverter for runtime type references.

Currently only supports conversion to and from a System.String.

Inheritance: System.ComponentModel.TypeConverter
Datei anzeigen Open project: spring-projects/spring-net Class Usage Examples

Public Methods

Method Description
CanConvertFrom ( ITypeDescriptorContext context, Type sourceType ) : bool

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

Currently only supports conversion from a System.String instance.

CanConvertTo ( ITypeDescriptorContext context, Type destinationType ) : bool

Returns whether this converter can convert the object to the specified System.Type.

ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object

Converts the given value to the type of this converter.

ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) : object

Converts the given value object to the specified type, using the specified context and culture information.

RuntimeTypeConverter ( ) : System

Creates a new instance of the Spring.Core.TypeConversion.RuntimeTypeConverter class.

Method Details

CanConvertFrom() public method

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

Currently only supports conversion from a System.String instance.

public CanConvertFrom ( ITypeDescriptorContext context, Type sourceType ) : bool
context ITypeDescriptorContext /// A /// that provides a format context. ///
sourceType System.Type /// A that represents the /// you want to convert from. ///
return bool

CanConvertTo() public method

Returns whether this converter can convert the object to the specified System.Type.
public CanConvertTo ( ITypeDescriptorContext context, Type destinationType ) : bool
context ITypeDescriptorContext /// A /// that provides a format context. ///
destinationType System.Type /// A that represents the /// you want to convert to. ///
return bool

ConvertFrom() public method

Converts the given value to the type of this converter.
public ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object
context ITypeDescriptorContext /// A /// that provides a format context. ///
culture System.Globalization.CultureInfo /// The to use /// as the current culture. ///
value object /// The value that is to be converted. ///
return object

ConvertTo() public method

Converts the given value object to the specified type, using the specified context and culture information.
public ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) : object
context ITypeDescriptorContext /// A /// that provides a format context. ///
culture System.Globalization.CultureInfo /// The to use /// as the current culture. ///
value object /// The value that is to be converted. ///
destinationType System.Type /// The to convert the /// parameter to. ///
return object

RuntimeTypeConverter() public method

Creates a new instance of the Spring.Core.TypeConversion.RuntimeTypeConverter class.
public RuntimeTypeConverter ( ) : System
return System