整理代码

This commit is contained in:
GG Z
2026-02-20 15:31:44 +08:00
parent 94cf3f3266
commit 9f121cfc7f
149 changed files with 4063 additions and 6964 deletions

View File

@@ -0,0 +1,21 @@
using System.Reflection;
using ShrlAlgoToolkit.Core.Assists;
using ShrlAlgoToolkit;
using ShrlAlgoToolkit.Core;
namespace ShrlAlgoToolkit.RevitAddins.Assists;
public static class EnumAssist
{
/// <summary>
/// 获取当前枚举值的描述,没有描述则返回空字符串
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static T GetAttribute<T>(this Enum value) where T : Attribute
{
var fieldInfo = value.GetType().GetField(value.ToString());
return fieldInfo.GetCustomAttribute<T>();
}
}