DragonECS-AutoInjections/src/Attributes/DIAttribute.cs
2026-03-16 10:37:20 +08:00

31 lines
926 B
C#

#if DISABLE_DEBUG
#undef DEBUG
#endif
using System;
namespace DCFApixels.DragonECS
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public class DIAttribute : Attribute
{
public static readonly DIAttribute Dummy = new DIAttribute();
public readonly Type NotNullDummyType = null;
public readonly string NamedInjection = string.Empty;
public DIAttribute() { }
public DIAttribute(string namedInjection)
{
NamedInjection = namedInjection;
}
public DIAttribute(Type notNullDummyType)
{
NotNullDummyType = notNullDummyType;
}
public DIAttribute(string namedInjection, Type notNullDummyType)
{
NamedInjection = namedInjection;
NotNullDummyType = notNullDummyType;
}
}
}