VirtualTypeBuilder.FieldInfoCollection.Add 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| Add(FieldInfo) |
将 FieldInfo 添加到集合的末尾。 |
| Add(String, Type) |
将 FieldInfo 添加到集合的末尾。 |
| Add(String, Type, Attribute[]) |
将 FieldInfo 添加到集合的末尾。 |
| Add(String, Type, Attribute[], FieldAttributes) |
将 FieldInfo 添加到集合的末尾。 |
Add(FieldInfo)
Add(String, Type)
将 FieldInfo 添加到集合的末尾。
public:
int Add(System::String ^ name, Type ^ fieldType);
public:
int Add(Platform::String ^ name, Platform::Type ^ fieldType);
public int Add (string name, Type fieldType);
member this.Add : string * Type -> int
Public Function Add (name As String, fieldType As Type) As Integer
参数
- name
- String
要添加的字段的名称。
- fieldType
- Type
字段的类型。
返回
已添加值处的索引。
例外
name 或 fieldType 为 null。
fieldType 不是运行时类型。
适用于
Add(String, Type, Attribute[])
将 FieldInfo 添加到集合的末尾。
public:
int Add(System::String ^ name, Type ^ fieldType, cli::array <Attribute ^> ^ attributes);
public:
int Add(Platform::String ^ name, Platform::Type ^ fieldType, Platform::Array <Platform::Metadata::Attribute ^> ^ attributes);
public int Add (string name, Type fieldType, Attribute[] attributes);
member this.Add : string * Type * Attribute[] -> int
Public Function Add (name As String, fieldType As Type, attributes As Attribute()) As Integer
参数
- name
- String
要添加的字段的名称。
- fieldType
- Type
字段的类型。
返回
已添加值处的索引。
例外
name 或 fieldType 中的元素 attributes 为 null 。 attributes 本身可能是 null 。
fieldType 不是运行时类型。
适用于
Add(String, Type, Attribute[], FieldAttributes)
将 FieldInfo 添加到集合的末尾。
public:
int Add(System::String ^ name, Type ^ fieldType, cli::array <Attribute ^> ^ attributes, System::Reflection::FieldAttributes fieldAttributes);
public int Add (string name, Type fieldType, Attribute[] attributes, System.Reflection.FieldAttributes fieldAttributes);
member this.Add : string * Type * Attribute[] * System.Reflection.FieldAttributes -> int
Public Function Add (name As String, fieldType As Type, attributes As Attribute(), fieldAttributes As FieldAttributes) As Integer
参数
- name
- String
要添加的字段的名称。
- fieldType
- Type
字段的类型。
- attributes
- Attribute[]
此参数用于对类成员进行相应的配置。 Add(String, Type, Attribute[], FieldAttributes) 仅接受适用于或类别的的值 MemberAttributes AccessMask ScopeMask 。
- fieldAttributes
- FieldAttributes
此参数为此成员指定其他字段属性。 默认字段特性为 Public 。 当前支持的字段属性为 Public 和 Static 。
返回
已添加值处的索引。
例外
name 或 fieldType 中的元素 attributes 为 null 。 attributes 本身可能是 null 。
fieldType 不是运行时类型-或-不 fieldAttributes 包含 Public 或包含除和以外的设置位 Public Static ,也不能将通过参数传入的特性 attributes 应用于字段。