IocNamedAttribute.cs 768 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. namespace IwbZero.IocNamed
  3. {
  4. /// <summary>
  5. /// 指定IocNamed
  6. /// </summary>
  7. [AttributeUsage(AttributeTargets.Class)]
  8. public class IocNamedAttribute : Attribute
  9. {
  10. /// <summary>
  11. /// 名称
  12. /// </summary>
  13. public string Name { get; set; }
  14. /// <summary>
  15. /// 是否使用全类名
  16. /// </summary>
  17. public bool UseFullName { get; set; }
  18. public IocNamedAttribute()
  19. {
  20. }
  21. public IocNamedAttribute(string name = "", bool useFullName = false)
  22. {
  23. Name = name;
  24. UseFullName = useFullName;
  25. }
  26. public bool NameIsNotNull()
  27. {
  28. return !string.IsNullOrEmpty(Name);
  29. }
  30. }
  31. }