Class ConvertUtils
Inheritance
System.Object
ConvertUtils
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Bayat.Json.Runtime.dll
Syntax
public static class ConvertUtils
Methods
|
Improve this Doc
View Source
Convert(Object, CultureInfo, Type)
Declaration
public static object Convert(object initialValue, CultureInfo culture, Type targetType)
Parameters
Type |
Name |
Description |
System.Object |
initialValue |
|
System.Globalization.CultureInfo |
culture |
|
System.Type |
targetType |
|
Returns
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
ConvertOrCast(Object, CultureInfo, Type)
Converts the value to the specified type. If the value is unable to be converted, the
value is checked whether it assignable to the specified type.
Declaration
public static object ConvertOrCast(object initialValue, CultureInfo culture, Type targetType)
Parameters
Type |
Name |
Description |
System.Object |
initialValue |
The value to convert.
|
System.Globalization.CultureInfo |
culture |
The culture to use when converting.
|
System.Type |
targetType |
The type to convert or cast the value to.
|
Returns
Type |
Description |
System.Object |
The converted type. If conversion was unsuccessful, the initial value
is returned if assignable to the target type.
|
|
Improve this Doc
View Source
FromBigInteger(BigInteger, Type)
Declaration
public static object FromBigInteger(BigInteger i, Type targetType)
Parameters
Type |
Name |
Description |
System.Numerics.BigInteger |
i |
|
System.Type |
targetType |
|
Returns
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
GetConverter(Type)
Declaration
public static TypeConverter GetConverter(Type t)
Parameters
Type |
Name |
Description |
System.Type |
t |
|
Returns
Type |
Description |
System.ComponentModel.TypeConverter |
|
|
Improve this Doc
View Source
GetTypeCode(Type)
Declaration
public static PrimitiveTypeCode GetTypeCode(Type t)
Parameters
Type |
Name |
Description |
System.Type |
t |
|
Returns
|
Improve this Doc
View Source
GetTypeCode(Type, out Boolean)
Declaration
public static PrimitiveTypeCode GetTypeCode(Type t, out bool isEnum)
Parameters
Type |
Name |
Description |
System.Type |
t |
|
System.Boolean |
isEnum |
|
Returns
|
Improve this Doc
View Source
Declaration
public static TypeInformation GetTypeInformation(IConvertible convertable)
Parameters
Type |
Name |
Description |
System.IConvertible |
convertable |
|
Returns
|
Improve this Doc
View Source
HexTextToInt(Char[], Int32, Int32)
Declaration
public static int HexTextToInt(char[] text, int start, int end)
Parameters
Type |
Name |
Description |
System.Char[] |
text |
|
System.Int32 |
start |
|
System.Int32 |
end |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Int32TryParse(Char[], Int32, Int32, out Int32)
Declaration
public static ParseResult Int32TryParse(char[] chars, int start, int length, out int value)
Parameters
Type |
Name |
Description |
System.Char[] |
chars |
|
System.Int32 |
start |
|
System.Int32 |
length |
|
System.Int32 |
value |
|
Returns
|
Improve this Doc
View Source
Int64TryParse(Char[], Int32, Int32, out Int64)
Declaration
public static ParseResult Int64TryParse(char[] chars, int start, int length, out long value)
Parameters
Type |
Name |
Description |
System.Char[] |
chars |
|
System.Int32 |
start |
|
System.Int32 |
length |
|
System.Int64 |
value |
|
Returns
|
Improve this Doc
View Source
IsConvertible(Type)
Declaration
public static bool IsConvertible(Type t)
Parameters
Type |
Name |
Description |
System.Type |
t |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsInteger(Object)
Declaration
public static bool IsInteger(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ParseTimeSpan(String)
Declaration
public static TimeSpan ParseTimeSpan(string input)
Parameters
Type |
Name |
Description |
System.String |
input |
|
Returns
Type |
Description |
System.TimeSpan |
|
|
Improve this Doc
View Source
ToBigInteger(Object)
Declaration
public static BigInteger ToBigInteger(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Returns
Type |
Description |
System.Numerics.BigInteger |
|
|
Improve this Doc
View Source
TryConvertGuid(String, out Guid)
Declaration
public static bool TryConvertGuid(string s, out Guid g)
Parameters
Type |
Name |
Description |
System.String |
s |
|
System.Guid |
g |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
VersionTryParse(String, out Version)
Declaration
public static bool VersionTryParse(string input, out Version result)
Parameters
Type |
Name |
Description |
System.String |
input |
|
System.Version |
result |
|
Returns
Type |
Description |
System.Boolean |
|