是否枚举 - IsSystemEnum
2017-02-26 15:26:53 访问(1438) 赞(0) 踩(0)
/// <summary>
/// typeof(System.Enum)
/// </summary>
protected readonly static Type typeSystemEnum = typeof(System.Enum);
/// <summary>
/// 是否枚举 - IsSystemEnum
/// </summary>
/// <param name="typeValue"></param>
/// <returns></returns>
public static bool IsSystemEnum(Type typeValue)
{
while (true)
{
if (typeValue == null)
return false;
if (typeValue == typeSystemEnum)
return true;
typeValue = typeValue.BaseType;
}
}
标签:
是否枚举 - IsSystemEnum 


上一条:
下一条:
相关评论
发表评论