using System; using System.Collections.Generic; using System.Text; namespace Apewer { /// 无依赖特性。 [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)] public sealed class IndependentAttribute : Attribute { string _remark = null; /// 无依赖特性。 public IndependentAttribute(string remark = null) => _remark = remark; /// 备注。 public string Remark { get { return _remark; } set { if (!string.IsNullOrEmpty(value)) _remark = value; } } /// 到 Boolean 的隐式转换,判断 有效。 public static implicit operator bool(IndependentAttribute instance) => instance != null; } }