我有一个枚举如下:
public enum DatabaseCommand
{
[Category("Connection")]
Connected= 0,
[Category("Connection")]
Disconnected,
[Category("Connection")]
GetConnectionStatus,
[Category("Execute")]
ExecuteSQLString,
[Category("Execute")]
ExecuteSQLStoreProcedure,
CustomCommand,
}
那么,如何通过传递typeof(DatabaseCommand)
列出所有类别属性并返回一个字符串数组,如下所示:
"Connection" , "Execute" and "".
有任何帮助吗? 谢谢!!!