mscorlib(4.0.0.0) API with additions
System.IConvertible Interface Reference

Defines methods that convert the value of the implementing reference or value type to a common language runtime type that has an equivalent value. More...

Inheritance diagram for System.IConvertible:
[legend]

Public Member Functions

TypeCode GetTypeCode ()
 Returns the T:System.TypeCode for this instance. More...
 
bool ToBoolean (IFormatProvider provider)
 Converts the value of this instance to an equivalent Boolean value using the specified culture-specific formatting information. More...
 
char ToChar (IFormatProvider provider)
 Converts the value of this instance to an equivalent Unicode character using the specified culture-specific formatting information. More...
 
sbyte ToSByte (IFormatProvider provider)
 Converts the value of this instance to an equivalent 8-bit signed integer using the specified culture-specific formatting information. More...
 
byte ToByte (IFormatProvider provider)
 Converts the value of this instance to an equivalent 8-bit unsigned integer using the specified culture-specific formatting information. More...
 
short ToInt16 (IFormatProvider provider)
 Converts the value of this instance to an equivalent 16-bit signed integer using the specified culture-specific formatting information. More...
 
ushort ToUInt16 (IFormatProvider provider)
 Converts the value of this instance to an equivalent 16-bit unsigned integer using the specified culture-specific formatting information. More...
 
int ToInt32 (IFormatProvider provider)
 Converts the value of this instance to an equivalent 32-bit signed integer using the specified culture-specific formatting information. More...
 
uint ToUInt32 (IFormatProvider provider)
 Converts the value of this instance to an equivalent 32-bit unsigned integer using the specified culture-specific formatting information. More...
 
long ToInt64 (IFormatProvider provider)
 Converts the value of this instance to an equivalent 64-bit signed integer using the specified culture-specific formatting information. More...
 
ulong ToUInt64 (IFormatProvider provider)
 Converts the value of this instance to an equivalent 64-bit unsigned integer using the specified culture-specific formatting information. More...
 
float ToSingle (IFormatProvider provider)
 Converts the value of this instance to an equivalent single-precision floating-point number using the specified culture-specific formatting information. More...
 
double ToDouble (IFormatProvider provider)
 Converts the value of this instance to an equivalent double-precision floating-point number using the specified culture-specific formatting information. More...
 
decimal ToDecimal (IFormatProvider provider)
 Converts the value of this instance to an equivalent T:System.Decimal number using the specified culture-specific formatting information. More...
 
DateTime ToDateTime (IFormatProvider provider)
 Converts the value of this instance to an equivalent T:System.DateTime using the specified culture-specific formatting information. More...
 
string ToString (IFormatProvider provider)
 Converts the value of this instance to an equivalent T:System.String using the specified culture-specific formatting information. More...
 
object ToType (Type conversionType, IFormatProvider provider)
 Converts the value of this instance to an T:System.Object of the specified T:System.Type that has an equivalent value, using the specified culture-specific formatting information. More...
 

Detailed Description

Defines methods that convert the value of the implementing reference or value type to a common language runtime type that has an equivalent value.

Definition at line 9 of file IConvertible.cs.

Member Function Documentation

◆ GetTypeCode()

TypeCode System.IConvertible.GetTypeCode ( )

Returns the T:System.TypeCode for this instance.

Returns
The enumerated constant that is the T:System.TypeCode of the class or value type that implements this interface.

Implemented in System.String, System.DateTime, System.Decimal, System.Enum, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, System.Boolean, and System.DBNull.

◆ ToBoolean()

bool System.IConvertible.ToBoolean ( IFormatProvider  provider)

Converts the value of this instance to an equivalent Boolean value using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
A Boolean value equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToByte()

byte System.IConvertible.ToByte ( IFormatProvider  provider)

Converts the value of this instance to an equivalent 8-bit unsigned integer using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
An 8-bit unsigned integer equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToChar()

char System.IConvertible.ToChar ( IFormatProvider  provider)

Converts the value of this instance to an equivalent Unicode character using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
A Unicode character equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToDateTime()

DateTime System.IConvertible.ToDateTime ( IFormatProvider  provider)

Converts the value of this instance to an equivalent T:System.DateTime using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
A T:System.DateTime instance equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToDecimal()

decimal System.IConvertible.ToDecimal ( IFormatProvider  provider)

Converts the value of this instance to an equivalent T:System.Decimal number using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
A T:System.Decimal number equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToDouble()

double System.IConvertible.ToDouble ( IFormatProvider  provider)

Converts the value of this instance to an equivalent double-precision floating-point number using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
A double-precision floating-point number equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToInt16()

short System.IConvertible.ToInt16 ( IFormatProvider  provider)

Converts the value of this instance to an equivalent 16-bit signed integer using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
An 16-bit signed integer equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToInt32()

int System.IConvertible.ToInt32 ( IFormatProvider  provider)

Converts the value of this instance to an equivalent 32-bit signed integer using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
An 32-bit signed integer equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToInt64()

long System.IConvertible.ToInt64 ( IFormatProvider  provider)

Converts the value of this instance to an equivalent 64-bit signed integer using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
An 64-bit signed integer equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToSByte()

sbyte System.IConvertible.ToSByte ( IFormatProvider  provider)

Converts the value of this instance to an equivalent 8-bit signed integer using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
An 8-bit signed integer equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToSingle()

float System.IConvertible.ToSingle ( IFormatProvider  provider)

Converts the value of this instance to an equivalent single-precision floating-point number using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
A single-precision floating-point number equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToString()

string System.IConvertible.ToString ( IFormatProvider  provider)

Converts the value of this instance to an equivalent T:System.String using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
A T:System.String instance equivalent to the value of this instance.

Implemented in System.String, System.DateTime, System.Enum, System.Decimal, System.Char, System.Double, System.Single, System.Byte, System.Int32, System.UInt32, System.UInt64, System.Int64, System.SByte, System.UInt16, System.Int16, System.Boolean, and System.DBNull.

◆ ToType()

object System.IConvertible.ToType ( Type  conversionType,
IFormatProvider  provider 
)

Converts the value of this instance to an T:System.Object of the specified T:System.Type that has an equivalent value, using the specified culture-specific formatting information.

Parameters
conversionTypeThe T:System.Type to which the value of this instance is converted.
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
An T:System.Object instance of type conversionType whose value is equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToUInt16()

ushort System.IConvertible.ToUInt16 ( IFormatProvider  provider)

Converts the value of this instance to an equivalent 16-bit unsigned integer using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
An 16-bit unsigned integer equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToUInt32()

uint System.IConvertible.ToUInt32 ( IFormatProvider  provider)

Converts the value of this instance to an equivalent 32-bit unsigned integer using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
An 32-bit unsigned integer equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.

◆ ToUInt64()

ulong System.IConvertible.ToUInt64 ( IFormatProvider  provider)

Converts the value of this instance to an equivalent 64-bit unsigned integer using the specified culture-specific formatting information.

Parameters
providerAn T:System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
An 64-bit unsigned integer equivalent to the value of this instance.

Implemented in System.DateTime, System.Decimal, System.Char, System.Double, System.Single, System.SByte, System.Int16, System.UInt16, System.Byte, System.UInt32, System.Int32, System.Int64, System.UInt64, and System.Boolean.


The documentation for this interface was generated from the following file: