BOB/Common/Attributes/BOBCommandAttribute.cs
2025-11-17 13:12:15 +08:00

33 lines
882 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common.Attributes
{
/// <summary>
/// 标记可加载到指令集中的类或方法
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public sealed class BOBCommandAttribute : Attribute
{
/// <summary>
/// 指令描述(用于工具提示)
/// </summary>
public string Description { get; }
/// <summary>
/// 指令分类(用于树形视图分组)
/// </summary>
public string Category { get; set; } = "默认分类";
public BOBCommandAttribute() { }
public BOBCommandAttribute(string description)
{
Description = description;
}
}
}