C# Class System.ComponentModel.DecimalConverter

显示文件 Open project: dotnet/corefx Class Usage Examples

Private Properties

Property Type Description
FromString object
FromString object
FromString object
ToString string

Public Methods

Method Description
CanConvertTo ( ITypeDescriptorContext context, Type destinationType ) : bool

Gets a value indicating whether this converter can convert an object to the given destination type using the context.

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

Converts the given object to another type. The most common types to convert are to and from a string object. The default implementation will make a call to ToString on the object if the object is valid and if the destination type is string. If this cannot convert to the desitnation type, this will throw a NotSupportedException.

Private Methods

Method Description
FromString ( string value, CultureInfo culture ) : object

Convert the given value to a string using the given CultureInfo

FromString ( string value, NumberFormatInfo formatInfo ) : object

Convert the given value to a string using the given formatInfo

FromString ( string value, int radix ) : object

Convert the given value to a string using the given radix

ToString ( object value, NumberFormatInfo formatInfo ) : string

Convert the given value from a string using the given formatInfo

Method Details

CanConvertTo() public method

Gets a value indicating whether this converter can convert an object to the given destination type using the context.

public CanConvertTo ( ITypeDescriptorContext context, Type destinationType ) : bool
context ITypeDescriptorContext
destinationType System.Type
return bool

ConvertTo() public method

Converts the given object to another type. The most common types to convert are to and from a string object. The default implementation will make a call to ToString on the object if the object is valid and if the destination type is string. If this cannot convert to the desitnation type, this will throw a NotSupportedException.
public ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) : object
context ITypeDescriptorContext
culture CultureInfo
value object
destinationType System.Type
return object