初始化CRICS

This commit is contained in:
2025-12-11 09:17:16 +08:00
commit 83247ec0a2
2735 changed files with 787765 additions and 0 deletions

42
Common/EnumDescription.cs Normal file
View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
namespace Common
{
public class EnumDescription
{
public static string GetDescription(Enum enumValue)
{
if (enumValue == null)
{
return String.Empty;
}
string strValue = enumValue.ToString();
Type enumType = enumValue.GetType();
FieldInfo fieldInfo = enumType.GetField(strValue);
Object[] attributes = fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false);
if (attributes != null && attributes.Length > 0)
{
return (attributes[0] as DescriptionAttribute).Description;
}
return strValue;
}
public static Dictionary<string, object> GetNameValueList(Type enumType)
{
Dictionary<string, object> nameValueList = new Dictionary<string, object>();
return nameValueList;
}
}
}