Skip to content

Class TypeParse

Namespace: Tool.Utils
Assembly: Tool.Net.dll

判读该值是否是可以被强制转换

csharp
public sealed class TypeParse

Inheritance

objectTypeParse

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Extension Methods

ObjectExtension.Add<T>(object, object, object), ObjectExtension.CopyEntity(object, object, params string[]), ObjectExtension.EntityToJson(object), ObjectExtension.EntityToJson(object, bool), ObjectExtension.EntityToJson(object, bool, string), DictionaryExtension.GetDictionary(object), TypeExtension.GetFieldKey(object, string, out bool), TypeExtension.GetFieldKey<T>(object, string, out bool), TypeExtension.GetFieldKey(object, Type, string, out bool), ObjectExtension.GetIntPtr(object), ObjectExtension.GetIntPtrInt(object), TypeExtension.GetPropertieFind(object, string, bool), TypeExtension.GetProperties(object), TypeExtension.GetPropertyKey(object, string, out bool), TypeExtension.GetPropertyKey<T>(object, string, out bool), TypeExtension.GetPropertyKey(object, Type, string, out bool), TypeExtension.GetValue(object, PropertyDescriptor), TypeExtension.GetValue(object, string, bool), TypeExtension.GetValue(object, string), ObjectExtension.Read<T>(object, object, int, int), ObjectExtension.Read<T>(object, int, object, int, int), DictionaryExtension.SetDictionary(object, IDictionary<string, object>), TypeExtension.SetFieldKey(object, string, object), TypeExtension.SetFieldKey<T>(object, string, object), TypeExtension.SetFieldKey(object, Type, string, object), TypeExtension.SetPropertyKey(object, string, object), TypeExtension.SetPropertyKey<T>(object, string, object), TypeExtension.SetPropertyKey(object, Type, string, object), TypeExtension.SetValue(object, PropertyDescriptor, object), TypeExtension.SetValue(object, string, object, bool), TypeExtension.SetValue(object, string, object), ObjectExtension.ToBase64String(object), ObjectExtension.ToBytes(object), ObjectExtension.ToBytes(object, out Type), DictionaryExtension.ToDictionary(object), DictionaryExtension.ToDictionary<T>(object), DictionaryExtension.ToIDictionary(object), DictionaryExtension.ToIDictionary<T>(object), ObjectExtension.ToJson(object), ObjectExtension.ToJson(object, JsonSerializerOptions), ObjectExtension.ToJsonWeb(object), ObjectExtension.ToJsonWeb(object, Action<JsonSerializerOptions>), ObjectExtension.ToTryVar<T>(object, T), ObjectExtension.ToVar<T>(object), ObjectExtension.ToVar(object, Type, bool), ObjectExtension.ToVar(object, string), ObjectExtension.ToXml(object)

Remarks

代码由逆血提供支持

Methods

ConvertDateTimeInt(DateTime)

转换时间为世界公认秒数。

csharp
public static double ConvertDateTimeInt(DateTime time)

Parameters

time DateTime

时间

Returns

double

ConvertIntDateTime(double)

转换世界公认秒数为时间格式

csharp
public static DateTime ConvertIntDateTime(double d)

Parameters

d double

秒数

Returns

DateTime

IsNumericArray(string[])

判断是不是数字

csharp
public static bool IsNumericArray(string[] strNumber)

Parameters

strNumber string[]

判断值 数组

Returns

bool

返回类型

SafeLongToInt32(long)

判断中的值是不是在32位以内

csharp
public static int SafeLongToInt32(long expression)

Parameters

expression long

判断值

Returns

int

返回类型

StrToBool(object, bool)

判读该值是否是类型

csharp
public static bool StrToBool(object expression, bool defValue)

Parameters

expression object

判断值

defValue bool

当判断值为空时返回的值

Returns

bool

返回类型

StrToFloat(object, float)

判读该值是否是类型

csharp
public static float StrToFloat(object expression, float defValue)

Parameters

expression object

判断值

defValue float

当判断值为空时返回的值

Returns

float

返回类型

StrToInt(object, int)

判读该值是否是类型

csharp
public static int StrToInt(object expression, int defValue)

Parameters

expression object

判断值

defValue int

当判断值为空时返回的值

Returns

int

返回类型

基于Apache-2.0协议开源