AttributeCallback 委托

定义

当某个类型需要特性时调用。Called when attributes are needed for a type.

public delegate void AttributeCallback(AttributeCallbackBuilder ^ builder);
public delegate void AttributeCallback(AttributeCallbackBuilder builder);
type AttributeCallback = delegate of AttributeCallbackBuilder -> unit
Public Delegate Sub AttributeCallback(builder As AttributeCallbackBuilder)

参数

builder
AttributeCallbackBuilder

可用于添加特性的 AttributeCallbackBuilderAn AttributeCallbackBuilder that can be used to add attributes.

注解

此回调可以推迟元数据特性的注册,并且能够提供代码来动态确定应该应用哪些特性。This callback enables delayed registration of metadata attributes as well as the ability to provide code that dynamically determines which attributes should be applied. 此回调提供给 AddCallback 类的 AttributeTableBuilder 方法使用。This callback is provided to the AddCallback method of the AttributeTableBuilder class.

AttributeCallbackBuilder 对象只能为请求元数据的类型生成特性。AttributeCallbackBuilder objects can build attributes only for the type that is requesting metadata.

扩展方法

GetMethodInfo(Delegate)

获取指示指定委托表示的方法的对象。Gets an object that represents the method represented by the specified delegate.

适用于