2024-11-12 18:18:43 +08:00

25 lines
707 B
C#

using JiShe.CollectBus.Common.Interfaces;
namespace JiShe.CollectBus.Common.Attributes
{
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
public class DependsOnAttribute : Attribute
{
// 依赖的模块
public Type ModuleType { get; private init; }
public DependsOnAttribute(Type type)
{
ModuleType = type;
}
}
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
public sealed class DependsOnAttribute<TModule> : DependsOnAttribute
where TModule : IJiSheModule
{
public DependsOnAttribute() : base(typeof(TModule))
{
}
}
}