📅  最后修改于: 2022-03-11 14:48:57.643000             🧑  作者: Mango
public static TEnum ParseEnum(string value) where TEnum : struct
{
TEnum tmp;
if (!Enum.TryParse(value, true, out tmp))
{
tmp = new TEnum();
}
return tmp;
}