Name

IConvertible

Synopsis

The IConvertible interface allows conversion of an object to basic data types and allows the conversion methods in the Convert class to use that object. When implementing the IConvertible interface, create your own type-specific methods for each of the supplied conversion methods.

Note that IConvertible allows one-way conversion from a custom type to other data types, but does not allow a conversion from a basic data type to a custom type.

Public Interface IConvertible
                  ' Public Instance Methods
   Public Function GetTypeCode() As TypeCode  
   Public Function ToBoolean(
        ByVal provider As IFormatProvider) As Boolean  
   Public Function ToByte(
        ByVal provider As IFormatProvider) As Byte  
   Public Function ToChar(
        ByVal provider As IFormatProvider) As Char  
   Public Function ToDateTime(
        ByVal provider As IFormatProvider) As Date  
   Public Function ToDecimal(
        ByVal provider As IFormatProvider) As Decimal  
   Public Function ToDouble(
        ByVal provider As IFormatProvider) As Double  
   Public Function ToInt16(
        ByVal provider As IFormatProvider) As Short  
   Public Function ToInt32(
        ByVal provider As IFormatProvider) As Integer  
   Public Function ToInt64(
        ByVal provider As IFormatProvider) As Long  
   Public Function ToSByte(
        ByVal provider As IFormatProvider) As SByte  
   Public Function ToSingle(
        ByVal provider As IFormatProvider) As Single  
   Public Function ToString(
        ByVal provider As IFormatProvider) As String  
   Public Function ToType(ByVal conversionType As Type, ByVal provider As IFormatProvider) As Object ...

Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.