CustomAttributeBuilder Construtores

Definição

Inicializa uma instância da classe CustomAttributeBuilder.Initializes an instances of the CustomAttributeBuilder class.

Sobrecargas

CustomAttributeBuilder(ConstructorInfo, Object[])

Inicializa uma instância da classe CustomAttributeBuilder dado o construtor para o atributo personalizado e os argumentos para o construtor.Initializes an instance of the CustomAttributeBuilder class given the constructor for the custom attribute and the arguments to the constructor.

CustomAttributeBuilder(ConstructorInfo, Object[], FieldInfo[], Object[])

Inicializa uma instância da classe CustomAttributeBuilder dado o construtor para o atributo personalizado, os argumentos para o construtor e um conjunto de pares nome-valor nomeados.Initializes an instance of the CustomAttributeBuilder class given the constructor for the custom attribute, the arguments to the constructor, and a set of named field/value pairs.

CustomAttributeBuilder(ConstructorInfo, Object[], PropertyInfo[], Object[])

Inicializa uma instância da classe CustomAttributeBuilder dado o construtor para o atributo personalizado, os argumentos para o construtor e um conjunto pares de valores ou propriedades nomeadas.Initializes an instance of the CustomAttributeBuilder class given the constructor for the custom attribute, the arguments to the constructor, and a set of named property or value pairs.

CustomAttributeBuilder(ConstructorInfo, Object[], PropertyInfo[], Object[], FieldInfo[], Object[])

Inicializa uma instância da classe CustomAttributeBuilder dado o construtor para o atributo personalizado, os argumentos para o construtor, um conjunto pares de valores ou propriedades nomeadas e um conjunto de campos nomeados ou pares de valores.Initializes an instance of the CustomAttributeBuilder class given the constructor for the custom attribute, the arguments to the constructor, a set of named property or value pairs, and a set of named field or value pairs.

CustomAttributeBuilder(ConstructorInfo, Object[])

Inicializa uma instância da classe CustomAttributeBuilder dado o construtor para o atributo personalizado e os argumentos para o construtor.Initializes an instance of the CustomAttributeBuilder class given the constructor for the custom attribute and the arguments to the constructor.

public:
 CustomAttributeBuilder(System::Reflection::ConstructorInfo ^ con, cli::array <System::Object ^> ^ constructorArgs);
public CustomAttributeBuilder (System.Reflection.ConstructorInfo con, object?[] constructorArgs);
public CustomAttributeBuilder (System.Reflection.ConstructorInfo con, object[] constructorArgs);
new System.Reflection.Emit.CustomAttributeBuilder : System.Reflection.ConstructorInfo * obj[] -> System.Reflection.Emit.CustomAttributeBuilder
Public Sub New (con As ConstructorInfo, constructorArgs As Object())

Parâmetros

con
ConstructorInfo

O construtor do atributo personalizado.The constructor for the custom attribute.

constructorArgs
Object[]

Os argumentos para o construtor do atributo personalizado.The arguments to the constructor of the custom attribute.

Exceções

con é privado ou estático.con is static or private.

- ou --or- O número de argumentos fornecidos não corresponde ao número de parâmetros do construtor conforme exigido pela convenção de chamada do construtor.The number of supplied arguments does not match the number of parameters of the constructor as required by the calling convention of the constructor.

- ou --or- O tipo de argumento fornecido não corresponde ao tipo do parâmetro declarado no construtor.The type of supplied argument does not match the type of the parameter declared in the constructor.

- ou --or- Um argumento fornecido é um tipo de referência diferente de String ou Type.A supplied argument is a reference type other than String or Type.

con ou constructorArgs é null.con or constructorArgs is null.

Comentários

Os elementos da constructorArgs matriz são restritos a tipos de elementos.The elements of the constructorArgs array are restricted to element types. Eles podem ser byte ,,,,,,, sbyte ,, int uint long ulong float double String char , bool , uma enumeração, um tipo, qualquer um dos tipos anteriores que foi convertido em um objeto ou uma matriz de dimensão única, com base em zero, de qualquer um dos tipos anteriores.They can be byte, sbyte, int, uint, long, ulong, float, double, String, char, bool, an enum, a type, any of the previous types that was cast to an object, or a single-dimension, zero-based array of any of the previous types.

Aplica-se a

CustomAttributeBuilder(ConstructorInfo, Object[], FieldInfo[], Object[])

Inicializa uma instância da classe CustomAttributeBuilder dado o construtor para o atributo personalizado, os argumentos para o construtor e um conjunto de pares nome-valor nomeados.Initializes an instance of the CustomAttributeBuilder class given the constructor for the custom attribute, the arguments to the constructor, and a set of named field/value pairs.

public:
 CustomAttributeBuilder(System::Reflection::ConstructorInfo ^ con, cli::array <System::Object ^> ^ constructorArgs, cli::array <System::Reflection::FieldInfo ^> ^ namedFields, cli::array <System::Object ^> ^ fieldValues);
public CustomAttributeBuilder (System.Reflection.ConstructorInfo con, object?[] constructorArgs, System.Reflection.FieldInfo[] namedFields, object?[] fieldValues);
public CustomAttributeBuilder (System.Reflection.ConstructorInfo con, object[] constructorArgs, System.Reflection.FieldInfo[] namedFields, object[] fieldValues);
public CustomAttributeBuilder (System.Reflection.ConstructorInfo con, object?[] constructorArgs, System.Reflection.FieldInfo[] namedFields, object[] fieldValues);
new System.Reflection.Emit.CustomAttributeBuilder : System.Reflection.ConstructorInfo * obj[] * System.Reflection.FieldInfo[] * obj[] -> System.Reflection.Emit.CustomAttributeBuilder
Public Sub New (con As ConstructorInfo, constructorArgs As Object(), namedFields As FieldInfo(), fieldValues As Object())

Parâmetros

con
ConstructorInfo

O construtor do atributo personalizado.The constructor for the custom attribute.

constructorArgs
Object[]

Os argumentos para o construtor do atributo personalizado.The arguments to the constructor of the custom attribute.

namedFields
FieldInfo[]

Campos nomeados do atributo personalizado.Named fields of the custom attribute.

fieldValues
Object[]

Valores dos campos nomeados do atributo personalizado.Values for the named fields of the custom attribute.

Exceções

Os comprimentos das matrizes namedFields e fieldValues são diferentes.The lengths of the namedFields and fieldValues arrays are different.

- ou --or- con é privado ou estático.con is static or private.

- ou --or- O número de argumentos fornecidos não corresponde ao número de parâmetros do construtor conforme exigido pela convenção de chamada do construtor.The number of supplied arguments does not match the number of parameters of the constructor as required by the calling convention of the constructor.

- ou --or- O tipo de argumento fornecido não corresponde ao tipo do parâmetro declarado no construtor.The type of supplied argument does not match the type of the parameter declared in the constructor.

- ou --or- Os tipos de valores de campo não correspondem aos tipos dos campos nomeados.The types of the field values do not match the types of the named fields.

- ou --or- O campo não pertence à mesma classe ou classe base do construtor.The field does not belong to the same class or base class as the constructor.

- ou --or- Um argumento ou campo nomeado fornecido é um tipo de referência diferente de String ou Type.A supplied argument or named field is a reference type other than String or Type.

Um dos parâmetros é null.One of the parameters is null.

Comentários

Os elementos das constructorArgs fieldValues matrizes e são restritos a tipos de elementos.The elements of the constructorArgs and fieldValues arrays are restricted to element types. Eles podem ser byte ,,,,,,, sbyte ,, int uint long ulong float double String char , bool , uma enumeração, um tipo, qualquer um dos tipos anteriores que foi convertido em um objeto ou uma matriz de dimensão única, com base em zero, de qualquer um dos tipos anteriores.They can be byte, sbyte, int, uint, long, ulong, float, double, String, char, bool, an enum, a type, any of the previous types that was cast to an object, or a single-dimension, zero-based array of any of the previous types.

Importante

Não inclua campos particulares no namedFields .Do not include private fields in namedFields. Isso fará com que CustomAttributeFormatException seja gerado quando o GetCustomAttributes método for chamado posteriormente no tipo concluído.Doing so will cause CustomAttributeFormatException to be thrown when the GetCustomAttributes method is later called on the completed type.

Aplica-se a

CustomAttributeBuilder(ConstructorInfo, Object[], PropertyInfo[], Object[])

Inicializa uma instância da classe CustomAttributeBuilder dado o construtor para o atributo personalizado, os argumentos para o construtor e um conjunto pares de valores ou propriedades nomeadas.Initializes an instance of the CustomAttributeBuilder class given the constructor for the custom attribute, the arguments to the constructor, and a set of named property or value pairs.

public:
 CustomAttributeBuilder(System::Reflection::ConstructorInfo ^ con, cli::array <System::Object ^> ^ constructorArgs, cli::array <System::Reflection::PropertyInfo ^> ^ namedProperties, cli::array <System::Object ^> ^ propertyValues);
public CustomAttributeBuilder (System.Reflection.ConstructorInfo con, object?[] constructorArgs, System.Reflection.PropertyInfo[] namedProperties, object?[] propertyValues);
public CustomAttributeBuilder (System.Reflection.ConstructorInfo con, object[] constructorArgs, System.Reflection.PropertyInfo[] namedProperties, object[] propertyValues);
public CustomAttributeBuilder (System.Reflection.ConstructorInfo con, object?[] constructorArgs, System.Reflection.PropertyInfo[] namedProperties, object[] propertyValues);
new System.Reflection.Emit.CustomAttributeBuilder : System.Reflection.ConstructorInfo * obj[] * System.Reflection.PropertyInfo[] * obj[] -> System.Reflection.Emit.CustomAttributeBuilder
Public Sub New (con As ConstructorInfo, constructorArgs As Object(), namedProperties As PropertyInfo(), propertyValues As Object())

Parâmetros

con
ConstructorInfo

O construtor do atributo personalizado.The constructor for the custom attribute.

constructorArgs
Object[]

Os argumentos para o construtor do atributo personalizado.The arguments to the constructor of the custom attribute.

namedProperties
PropertyInfo[]

Propriedades nomeadas do atributo personalizado.Named properties of the custom attribute.

propertyValues
Object[]

Valores para as propriedades nomeadas do atributo personalizado.Values for the named properties of the custom attribute.

Exceções

Os comprimentos das matrizes namedProperties e propertyValues são diferentes.The lengths of the namedProperties and propertyValues arrays are different.

- ou --or- con é privado ou estático.con is static or private.

- ou --or- O número de argumentos fornecidos não corresponde ao número de parâmetros do construtor conforme exigido pela convenção de chamada do construtor.The number of supplied arguments does not match the number of parameters of the constructor as required by the calling convention of the constructor.

- ou --or- O tipo de argumento fornecido não corresponde ao tipo do parâmetro declarado no construtor.The type of supplied argument does not match the type of the parameter declared in the constructor.

- ou --or- Os tipos de valores de propriedade não correspondem aos tipos das propriedades nomeadas.The types of the property values do not match the types of the named properties.

- ou --or- Uma propriedade não tem nenhum método setter.A property has no setter method.

- ou --or- A propriedade não pertence à mesma classe ou classe base do construtor.The property does not belong to the same class or base class as the constructor.

- ou --or- Um argumento ou propriedade nomeada fornecido é um tipo de referência diferente de String ou Type.A supplied argument or named property is a reference type other than String or Type.

Um dos parâmetros é null.One of the parameters is null.

Comentários

Os elementos das constructorArgs propertyValues matrizes e são restritos a tipos de elementos.The elements of the constructorArgs and propertyValues arrays are restricted to element types. Eles podem ser byte ,,,,,,, sbyte ,, int uint long ulong float double String char , bool , uma enumeração, um tipo, qualquer um dos tipos anteriores que foi convertido em um objeto ou uma matriz de dimensão única, com base em zero, de qualquer um dos tipos anteriores.They can be byte, sbyte, int, uint, long, ulong, float, double, String, char, bool, an enum, a type, any of the previous types that was cast to an object, or a single-dimension, zero-based array of any of the previous types.

Importante

Não inclua propriedades privadas no namedProperties .Do not include private properties in namedProperties. Isso fará com que CustomAttributeFormatException seja gerado quando o GetCustomAttributes método for chamado posteriormente no tipo concluído.Doing so will cause CustomAttributeFormatException to be thrown when the GetCustomAttributes method is later called on the completed type.

Aplica-se a

CustomAttributeBuilder(ConstructorInfo, Object[], PropertyInfo[], Object[], FieldInfo[], Object[])

Inicializa uma instância da classe CustomAttributeBuilder dado o construtor para o atributo personalizado, os argumentos para o construtor, um conjunto pares de valores ou propriedades nomeadas e um conjunto de campos nomeados ou pares de valores.Initializes an instance of the CustomAttributeBuilder class given the constructor for the custom attribute, the arguments to the constructor, a set of named property or value pairs, and a set of named field or value pairs.

public:
 CustomAttributeBuilder(System::Reflection::ConstructorInfo ^ con, cli::array <System::Object ^> ^ constructorArgs, cli::array <System::Reflection::PropertyInfo ^> ^ namedProperties, cli::array <System::Object ^> ^ propertyValues, cli::array <System::Reflection::FieldInfo ^> ^ namedFields, cli::array <System::Object ^> ^ fieldValues);
public CustomAttributeBuilder (System.Reflection.ConstructorInfo con, object?[] constructorArgs, System.Reflection.PropertyInfo[] namedProperties, object?[] propertyValues, System.Reflection.FieldInfo[] namedFields, object?[] fieldValues);
public CustomAttributeBuilder (System.Reflection.ConstructorInfo con, object[] constructorArgs, System.Reflection.PropertyInfo[] namedProperties, object[] propertyValues, System.Reflection.FieldInfo[] namedFields, object[] fieldValues);
public CustomAttributeBuilder (System.Reflection.ConstructorInfo con, object?[] constructorArgs, System.Reflection.PropertyInfo[] namedProperties, object[] propertyValues, System.Reflection.FieldInfo[] namedFields, object[] fieldValues);
new System.Reflection.Emit.CustomAttributeBuilder : System.Reflection.ConstructorInfo * obj[] * System.Reflection.PropertyInfo[] * obj[] * System.Reflection.FieldInfo[] * obj[] -> System.Reflection.Emit.CustomAttributeBuilder
Public Sub New (con As ConstructorInfo, constructorArgs As Object(), namedProperties As PropertyInfo(), propertyValues As Object(), namedFields As FieldInfo(), fieldValues As Object())

Parâmetros

con
ConstructorInfo

O construtor do atributo personalizado.The constructor for the custom attribute.

constructorArgs
Object[]

Os argumentos para o construtor do atributo personalizado.The arguments to the constructor of the custom attribute.

namedProperties
PropertyInfo[]

Propriedades nomeadas do atributo personalizado.Named properties of the custom attribute.

propertyValues
Object[]

Valores para as propriedades nomeadas do atributo personalizado.Values for the named properties of the custom attribute.

namedFields
FieldInfo[]

Campos nomeados do atributo personalizado.Named fields of the custom attribute.

fieldValues
Object[]

Valores dos campos nomeados do atributo personalizado.Values for the named fields of the custom attribute.

Exceções

Os comprimentos das matrizes namedProperties e propertyValues são diferentes.The lengths of the namedProperties and propertyValues arrays are different.

- ou --or- Os comprimentos das matrizes namedFields e fieldValues são diferentes.The lengths of the namedFields and fieldValues arrays are different.

- ou --or- con é privado ou estático.con is static or private.

- ou --or- O número de argumentos fornecidos não corresponde ao número de parâmetros do construtor conforme exigido pela convenção de chamada do construtor.The number of supplied arguments does not match the number of parameters of the constructor as required by the calling convention of the constructor.

- ou --or- O tipo de argumento fornecido não corresponde ao tipo do parâmetro declarado no construtor.The type of supplied argument does not match the type of the parameter declared in the constructor.

- ou --or- Os tipos de valores de propriedade não correspondem aos tipos das propriedades nomeadas.The types of the property values do not match the types of the named properties.

- ou --or- Os tipos de valores de campo não correspondem aos tipos dos campos correspondentes.The types of the field values do not match the types of the corresponding field types.

- ou --or- Uma propriedade não tem nenhum setter.A property has no setter.

- ou --or- A propriedade ou campo não pertence à mesma classe ou classe base do construtor.The property or field does not belong to the same class or base class as the constructor.

- ou --or- Um argumento, propriedade nomeada ou campo nomeado fornecido é um tipo de referência diferente de String ou Type.A supplied argument, named property, or named field is a reference type other than String or Type.

Um dos parâmetros é null.One of the parameters is null.

Comentários

Os elementos das constructorArgs propertyValues matrizes, ou fieldValues são restritos a tipos de elementos.The elements of the constructorArgs, propertyValues, or fieldValues arrays are restricted to element types. Eles podem ser byte ,,,,,,, sbyte ,, int uint long ulong float double String char , bool , uma enumeração, um tipo, qualquer um dos tipos anteriores que foi convertido em um objeto ou uma matriz de dimensão única, com base em zero, de qualquer um dos tipos anteriores.They can be byte, sbyte, int, uint, long, ulong, float, double, String, char, bool, an enum, a type, any of the previous types that was cast to an object, or a single-dimension, zero-based array of any of the previous types.

Importante

Não inclua propriedades ou campos particulares no namedProperties ou no namedFields .Do not include private properties or fields in namedProperties or namedFields. Isso fará com que CustomAttributeFormatException seja gerado quando o GetCustomAttributes método for chamado posteriormente no tipo concluído.Doing so will cause CustomAttributeFormatException to be thrown when the GetCustomAttributes method is later called on the completed type.

Aplica-se a