类定义:
// 摘要: // 指定另一特性类的用法。 此类不能被继承。 [Serializable] [AttributeUsage(AttributeTargets.Class, Inherited = true)] [ComVisible(true)] public sealed class AttributeUsageAttribute : Attribute { // 摘要: // 用指定的 System.AttributeTargets、System.AttributeUsageAttribute.AllowMultiple // 值和 System.AttributeUsageAttribute.Inherited 值列表初始化 System.AttributeUsageAttribute // 类的新实例。 // // 参数: // validOn: // 使用按位"或"运算符组合的一组值,用于指示哪些程序元素是有效的。 public AttributeUsageAttribute(AttributeTargets validOn); // 摘要: // 获取或设置一个布尔值,该值指示能否为一个程序元素指定多个指示属性实例。 // // 返回结果: // 如果允许指定多个实例,则为 true;否则为 false。 默认值为 false。 public bool AllowMultiple { get; set; } // // 摘要: // 获取或设置一个布尔值,该值指示指示的属性能否由派生类和重写成员继承。 // // 返回结果: // 如果该属性可由派生类和重写成员继承,则为 true,否则为 false。 默认值为 true。 public bool Inherited { get; set; } // // 摘要: // 获取一组值,这组值标识指示的属性可应用到的程序元素。 // // 返回结果: // 一个或多个 System.AttributeTargets 值。 默认值为 All。 public AttributeTargets ValidOn { get; } }