ConvertibleHelper Class
Namespace: PTS
Assembly: PTSframework.dll
Provides a set of static methods for IConvertible type.
Syntax
public static class ConvertibleHelper
Inheritance
Methods
ToBoolean(IConvertible, IFormatProvider)
Converts the value of this instance to an equivalent bool value.
Declaration
public static bool ToBoolean(this IConvertible value, IFormatProvider provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IConvertible | value | The value to convert. |
| System.IFormatProvider | provider | Optional provider implementation that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A |
ToDecimal(IConvertible, IFormatProvider)
Converts the value of this instance to an equivalent decimal number.
Declaration
public static decimal ToDecimal(this IConvertible value, IFormatProvider provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IConvertible | value | The value to convert. |
| System.IFormatProvider | provider | Optional provider implementation that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| System.Decimal | A |
ToInt32(IConvertible, IFormatProvider)
Converts the value of this instance to an equivalent int number.
Declaration
public static int ToInt32(this IConvertible value, IFormatProvider provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IConvertible | value | The value to convert. |
| System.IFormatProvider | provider | Optional provider implementation that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| System.Int32 | A |
ToLong(IConvertible, IFormatProvider)
Converts the value of this instance to an equivalent long number.
Declaration
public static long ToLong(this IConvertible value, IFormatProvider provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IConvertible | value | The value to convert. |
| System.IFormatProvider | provider | Optional provider implementation that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| System.Int64 | A |
ToNullBoolean(IConvertible, IFormatProvider)
Converts the value of this instance to an equivalent bool value.
Declaration
public static bool? ToNullBoolean(this IConvertible value, IFormatProvider provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IConvertible | value | The value to convert. |
| System.IFormatProvider | provider | Optional provider implementation that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> | A |
ToNullLong(IConvertible, IFormatProvider)
Converts the value of this instance to an equivalent long? number.
Declaration
public static long? ToNullLong(this IConvertible value, IFormatProvider provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IConvertible | value | The value to convert. |
| System.IFormatProvider | provider | Optional provider implementation that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Int64> | A |
ToNullULong(IConvertible, IFormatProvider)
Converts the value of this instance to an equivalent ulong? number.
Declaration
public static ulong? ToNullULong(this IConvertible value, IFormatProvider provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IConvertible | value | The value to convert. |
| System.IFormatProvider | provider | Optional provider implementation that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.UInt64> | A |
ToText(IConvertible, IFormatProvider)
Converts the value of this instance to an equivalent string.
Declaration
public static string ToText(this IConvertible value, IFormatProvider provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IConvertible | value | The value to convert. |
| System.IFormatProvider | provider | Optional provider implementation that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| System.String | A |
ToUInt32(IConvertible, IFormatProvider)
Converts the value of this instance to an equivalent uint number.
Declaration
public static uint ToUInt32(this IConvertible value, IFormatProvider provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IConvertible | value | The value to convert. |
| System.IFormatProvider | provider | Optional provider implementation that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| System.UInt32 | A |
ToULong(IConvertible, IFormatProvider)
Converts the value of this instance to an equivalent ulong number.
Declaration
public static ulong ToULong(this IConvertible value, IFormatProvider provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IConvertible | value | The value to convert. |
| System.IFormatProvider | provider | Optional provider implementation that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| System.UInt64 | A |