You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
905 B

4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Apewer
  5. {
  6. /// <summary>无依赖特性。</summary>
  7. [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)]
  8. public sealed class IndependentAttribute : Attribute
  9. {
  10. string _remark = null;
  11. /// <summary>无依赖特性。</summary>
  12. public IndependentAttribute(string remark = null) => _remark = remark;
  13. /// <summary>备注。</summary>
  14. public string Remark
  15. {
  16. get { return _remark; }
  17. set { if (!string.IsNullOrEmpty(value)) _remark = value; }
  18. }
  19. /// <summary>从 <see cref="IndependentAttribute"/> 到 Boolean 的隐式转换,判断 <see cref="IndependentAttribute"/> 有效。</summary>
  20. public static implicit operator bool(IndependentAttribute instance) => instance != null;
  21. }
  22. }