Edit

Kongsi melalui


TypeBuilder.DefineInitializedData(String, Byte[], FieldAttributes) Method

Definition

Defines initialized data field in the .sdata section of the portable executable (PE) file.

public:
 System::Reflection::Emit::FieldBuilder ^ DefineInitializedData(System::String ^ name, cli::array <System::Byte> ^ data, System::Reflection::FieldAttributes attributes);
public System.Reflection.Emit.FieldBuilder DefineInitializedData (string name, byte[] data, System.Reflection.FieldAttributes attributes);
member this.DefineInitializedData : string * byte[] * System.Reflection.FieldAttributes -> System.Reflection.Emit.FieldBuilder
Public Function DefineInitializedData (name As String, data As Byte(), attributes As FieldAttributes) As FieldBuilder

Parameters

name
String

The name used to refer to the data. name cannot contain embedded nulls.

data
Byte[]

The blob of data.

attributes
FieldAttributes

The attributes for the field.

Returns

A field to reference the data.

Exceptions

Length of name is zero.

-or-

The size of the data is less than or equal to zero, or greater than or equal to 0x3f0000.

name or data is null.

CreateType() has been previously called.

Remarks

The field that you create with this method will be static, even if you do not include FieldAttributes.Static in the attributes parameter.

Applies to