Class ObjectExtensions
- Namespace
- BootstrapBlazor.Components
- Assembly
- BootstrapBlazor.dll
Object 扩展方法
public static class ObjectExtensions
- Inheritance
-
ObjectExtensions
- Inherited Members
Methods
ConvertToPercentString(string?)
转化为带单位的字符串 [% px] => [% px] [int] => [int]px
public static string ConvertToPercentString(this string? val)
Parameters
val
string
Returns
GetTypeDesc(Type)
通过类型获取类型描述文字
public static string GetTypeDesc(this Type t)
Parameters
t
Type
Returns
IsBoolean(Type)
检查是否为 Boolean 数据类型
public static bool IsBoolean(this Type t)
Parameters
t
Type
Returns
IsDateTime(Type)
检查是否为 DateTime 数据类型
public static bool IsDateTime(this Type t)
Parameters
t
Type
Returns
IsNumber(Type)
检查是否为 Number 数据类型
public static bool IsNumber(this Type t)
Parameters
t
Type
Returns
IsTimeSpan(Type)
检查是否为 TimeSpan 数据类型
public static bool IsTimeSpan(this Type t)
Parameters
t
Type
Returns
ToFileSizeString(long)
格式化为 文件大小与单位格式 字符串
public static string ToFileSizeString(this long fileSize)
Parameters
fileSize
long
Returns
TryConvertTo(string?, Type, out object?)
字符串类型转换为其他数据类型
public static bool TryConvertTo(this string? source, Type type, out object? val)
Parameters
Returns
TryConvertTo<TValue>(string?, out TValue)
public static bool TryConvertTo<TValue>(this string? source, out TValue val)
Parameters
source
stringval
TValue
Returns
Type Parameters
TValue