ModuleBuilder.GetCustomAttributesData 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回已应用于当前 ModuleBuilder(以对象表示 CustomAttributeData )的属性的相关信息。
public:
override System::Collections::Generic::IList<System::Reflection::CustomAttributeData ^> ^ GetCustomAttributesData();
public override System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData();
override this.GetCustomAttributesData : unit -> System.Collections.Generic.IList<System.Reflection.CustomAttributeData>
Public Overrides Function GetCustomAttributesData () As IList(Of CustomAttributeData)
返回
表示已应用于当前模块的属性的对象的泛型列表 CustomAttributeData 。
注解
使用此方法在仅反射上下文中检查代码的自定义属性,以防自定义属性本身在加载到仅反射上下文的代码中定义。 诸如 Attribute.GetCustomAttributes 此类方法,并且 Assembly.GetCustomAttributes 不能在此类情况下使用,因为它们会创建属性的实例。 无法执行仅反射上下文中的代码。 有关详细信息和示例代码,请参阅该 CustomAttributeData 类。