TypeBuilder.DefineFieldCore 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在派生类中重写时,将具有给定名称、属性、字段类型和自定义修饰符的新字段添加到类型。
protected:
abstract System::Reflection::Emit::FieldBuilder ^ DefineFieldCore(System::String ^ fieldName, Type ^ type, cli::array <Type ^> ^ requiredCustomModifiers, cli::array <Type ^> ^ optionalCustomModifiers, System::Reflection::FieldAttributes attributes);
protected abstract System.Reflection.Emit.FieldBuilder DefineFieldCore (string fieldName, Type type, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers, System.Reflection.FieldAttributes attributes);
abstract member DefineFieldCore : string * Type * Type[] * Type[] * System.Reflection.FieldAttributes -> System.Reflection.Emit.FieldBuilder
Protected MustOverride Function DefineFieldCore (fieldName As String, type As Type, requiredCustomModifiers As Type(), optionalCustomModifiers As Type(), attributes As FieldAttributes) As FieldBuilder
参数
- fieldName
- String
字段的名称。 fieldName
不能包含嵌入的 null。
- type
- Type
字段的类型。
- requiredCustomModifiers
- Type[]
表示字段所需的自定义修饰符的类型数组。
- optionalCustomModifiers
- Type[]
表示字段的可选自定义修饰符的类型数组。
- attributes
- FieldAttributes
枚举值的按位组合,指定字段的属性。
返回
已定义的字段。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈