PropertyBuilder Classe
Definição
Define as propriedades de um tipo.Defines the properties for a type.
public ref class PropertyBuilder sealed : System::Reflection::PropertyInfo
public ref class PropertyBuilder sealed : System::Reflection::PropertyInfo, System::Runtime::InteropServices::_PropertyBuilder
public ref class PropertyBuilder abstract : System::Reflection::PropertyInfo
public sealed class PropertyBuilder : System.Reflection.PropertyInfo
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
public sealed class PropertyBuilder : System.Reflection.PropertyInfo, System.Runtime.InteropServices._PropertyBuilder
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class PropertyBuilder : System.Reflection.PropertyInfo, System.Runtime.InteropServices._PropertyBuilder
public abstract class PropertyBuilder : System.Reflection.PropertyInfo
type PropertyBuilder = class
inherit PropertyInfo
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
type PropertyBuilder = class
inherit PropertyInfo
interface _PropertyBuilder
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type PropertyBuilder = class
inherit PropertyInfo
interface _PropertyBuilder
Public NotInheritable Class PropertyBuilder
Inherits PropertyInfo
Public NotInheritable Class PropertyBuilder
Inherits PropertyInfo
Implements _PropertyBuilder
Public MustInherit Class PropertyBuilder
Inherits PropertyInfo
- Herança
- Atributos
- Implementações
Exemplos
O exemplo de código a seguir demonstra como implementar propriedades em um tipo dinâmico usando um PropertyBuilder obtido via TypeBuilder.DefineProperty para criar a estrutura de propriedade e um associado MethodBuilder para implementar a lógica de Il dentro da propriedade.The following code sample demonstrates how to implement properties in a dynamic type using a PropertyBuilder obtained via TypeBuilder.DefineProperty to create the property framework and an associated MethodBuilder to implement the IL logic within the property.
using namespace System;
using namespace System::Threading;
using namespace System::Reflection;
using namespace System::Reflection::Emit;
Type^ BuildDynamicTypeWithProperties()
{
AppDomain^ myDomain = Thread::GetDomain();
AssemblyName^ myAsmName = gcnew AssemblyName;
myAsmName->Name = "MyDynamicAssembly";
// To generate a persistable assembly, specify AssemblyBuilderAccess::RunAndSave.
AssemblyBuilder^ myAsmBuilder =
myDomain->DefineDynamicAssembly( myAsmName, AssemblyBuilderAccess::RunAndSave );
// Generate a persistable single-module assembly.
ModuleBuilder^ myModBuilder =
myAsmBuilder->DefineDynamicModule( myAsmName->Name, myAsmName->Name + ".dll" );
TypeBuilder^ myTypeBuilder = myModBuilder->DefineType( "CustomerData", TypeAttributes::Public );
// Define a private field to hold the property value.
FieldBuilder^ customerNameBldr = myTypeBuilder->DefineField( "customerName", String::typeid, FieldAttributes::Private );
// The last argument of DefineProperty is an empty array of Type
// objects, because the property has no parameters. (Alternatively,
// you can specify a null value.)
PropertyBuilder^ custNamePropBldr =
myTypeBuilder->DefineProperty( "CustomerName", PropertyAttributes::HasDefault, String::typeid, gcnew array<Type^>(0) );
// The property set and property get methods require a special
// set of attributes.
MethodAttributes getSetAttr =
MethodAttributes::Public | MethodAttributes::SpecialName |
MethodAttributes::HideBySig;
// Define the "get" accessor method for CustomerName.
MethodBuilder^ custNameGetPropMthdBldr =
myTypeBuilder->DefineMethod( "get_CustomerName",
getSetAttr,
String::typeid,
Type::EmptyTypes );
ILGenerator^ custNameGetIL = custNameGetPropMthdBldr->GetILGenerator();
custNameGetIL->Emit( OpCodes::Ldarg_0 );
custNameGetIL->Emit( OpCodes::Ldfld, customerNameBldr );
custNameGetIL->Emit( OpCodes::Ret );
// Define the "set" accessor method for CustomerName.
array<Type^>^temp2 = {String::typeid};
MethodBuilder^ custNameSetPropMthdBldr =
myTypeBuilder->DefineMethod( "set_CustomerName",
getSetAttr,
nullptr,
temp2 );
ILGenerator^ custNameSetIL = custNameSetPropMthdBldr->GetILGenerator();
custNameSetIL->Emit( OpCodes::Ldarg_0 );
custNameSetIL->Emit( OpCodes::Ldarg_1 );
custNameSetIL->Emit( OpCodes::Stfld, customerNameBldr );
custNameSetIL->Emit( OpCodes::Ret );
// Last, we must map the two methods created above to our PropertyBuilder to
// their corresponding behaviors, "get" and "set" respectively.
custNamePropBldr->SetGetMethod( custNameGetPropMthdBldr );
custNamePropBldr->SetSetMethod( custNameSetPropMthdBldr );
Type^ retval = myTypeBuilder->CreateType();
// Save the assembly so it can be examined with Ildasm.exe,
// or referenced by a test program.
myAsmBuilder->Save(myAsmName->Name + ".dll");
return retval;
}
int main()
{
Type^ custDataType = BuildDynamicTypeWithProperties();
array<PropertyInfo^>^custDataPropInfo = custDataType->GetProperties();
System::Collections::IEnumerator^ myEnum = custDataPropInfo->GetEnumerator();
while ( myEnum->MoveNext() )
{
PropertyInfo^ pInfo = safe_cast<PropertyInfo^>(myEnum->Current);
Console::WriteLine( "Property '{0}' created!", pInfo );
}
Console::WriteLine( "---" );
// Note that when invoking a property, you need to use the proper BindingFlags -
// BindingFlags::SetProperty when you invoke the "set" behavior, and
// BindingFlags::GetProperty when you invoke the "get" behavior. Also note that
// we invoke them based on the name we gave the property, as expected, and not
// the name of the methods we bound to the specific property behaviors.
Object^ custData = Activator::CreateInstance( custDataType );
array<Object^>^temp3 = {"Joe User"};
custDataType->InvokeMember( "CustomerName", BindingFlags::SetProperty, nullptr, custData, temp3 );
Console::WriteLine( "The customerName field of instance custData has been set to '{0}'.", custDataType->InvokeMember( "CustomerName", BindingFlags::GetProperty, nullptr, custData, gcnew array<Object^>(0) ) );
}
// --- O U T P U T ---
// The output should be as follows:
// -------------------
// Property 'System.String CustomerName' created!
// ---
// The customerName field of instance custData has been set to 'Joe User'.
// -------------------
using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;
class PropertyBuilderDemo
{
public static Type BuildDynamicTypeWithProperties()
{
AppDomain myDomain = Thread.GetDomain();
AssemblyName myAsmName = new AssemblyName();
myAsmName.Name = "MyDynamicAssembly";
// To generate a persistable assembly, specify AssemblyBuilderAccess.RunAndSave.
AssemblyBuilder myAsmBuilder = myDomain.DefineDynamicAssembly(myAsmName,
AssemblyBuilderAccess.RunAndSave);
// Generate a persistable single-module assembly.
ModuleBuilder myModBuilder =
myAsmBuilder.DefineDynamicModule(myAsmName.Name, myAsmName.Name + ".dll");
TypeBuilder myTypeBuilder = myModBuilder.DefineType("CustomerData",
TypeAttributes.Public);
FieldBuilder customerNameBldr = myTypeBuilder.DefineField("customerName",
typeof(string),
FieldAttributes.Private);
// The last argument of DefineProperty is null, because the
// property has no parameters. (If you don't specify null, you must
// specify an array of Type objects. For a parameterless property,
// use an array with no elements: new Type[] {})
PropertyBuilder custNamePropBldr = myTypeBuilder.DefineProperty("CustomerName",
PropertyAttributes.HasDefault,
typeof(string),
null);
// The property set and property get methods require a special
// set of attributes.
MethodAttributes getSetAttr =
MethodAttributes.Public | MethodAttributes.SpecialName |
MethodAttributes.HideBySig;
// Define the "get" accessor method for CustomerName.
MethodBuilder custNameGetPropMthdBldr =
myTypeBuilder.DefineMethod("get_CustomerName",
getSetAttr,
typeof(string),
Type.EmptyTypes);
ILGenerator custNameGetIL = custNameGetPropMthdBldr.GetILGenerator();
custNameGetIL.Emit(OpCodes.Ldarg_0);
custNameGetIL.Emit(OpCodes.Ldfld, customerNameBldr);
custNameGetIL.Emit(OpCodes.Ret);
// Define the "set" accessor method for CustomerName.
MethodBuilder custNameSetPropMthdBldr =
myTypeBuilder.DefineMethod("set_CustomerName",
getSetAttr,
null,
new Type[] { typeof(string) });
ILGenerator custNameSetIL = custNameSetPropMthdBldr.GetILGenerator();
custNameSetIL.Emit(OpCodes.Ldarg_0);
custNameSetIL.Emit(OpCodes.Ldarg_1);
custNameSetIL.Emit(OpCodes.Stfld, customerNameBldr);
custNameSetIL.Emit(OpCodes.Ret);
// Last, we must map the two methods created above to our PropertyBuilder to
// their corresponding behaviors, "get" and "set" respectively.
custNamePropBldr.SetGetMethod(custNameGetPropMthdBldr);
custNamePropBldr.SetSetMethod(custNameSetPropMthdBldr);
Type retval = myTypeBuilder.CreateType();
// Save the assembly so it can be examined with Ildasm.exe,
// or referenced by a test program.
myAsmBuilder.Save(myAsmName.Name + ".dll");
return retval;
}
public static void Main()
{
Type custDataType = BuildDynamicTypeWithProperties();
PropertyInfo[] custDataPropInfo = custDataType.GetProperties();
foreach (PropertyInfo pInfo in custDataPropInfo) {
Console.WriteLine("Property '{0}' created!", pInfo.ToString());
}
Console.WriteLine("---");
// Note that when invoking a property, you need to use the proper BindingFlags -
// BindingFlags.SetProperty when you invoke the "set" behavior, and
// BindingFlags.GetProperty when you invoke the "get" behavior. Also note that
// we invoke them based on the name we gave the property, as expected, and not
// the name of the methods we bound to the specific property behaviors.
object custData = Activator.CreateInstance(custDataType);
custDataType.InvokeMember("CustomerName", BindingFlags.SetProperty,
null, custData, new object[]{ "Joe User" });
Console.WriteLine("The customerName field of instance custData has been set to '{0}'.",
custDataType.InvokeMember("CustomerName", BindingFlags.GetProperty,
null, custData, new object[]{ }));
}
}
// --- O U T P U T ---
// The output should be as follows:
// -------------------
// Property 'System.String CustomerName' created!
// ---
// The customerName field of instance custData has been set to 'Joe User'.
// -------------------
Imports System.Threading
Imports System.Reflection
Imports System.Reflection.Emit
Class PropertyBuilderDemo
Public Shared Function BuildDynamicTypeWithProperties() As Type
Dim myDomain As AppDomain = Thread.GetDomain()
Dim myAsmName As New AssemblyName()
myAsmName.Name = "MyDynamicAssembly"
' To generate a persistable assembly, specify AssemblyBuilderAccess.RunAndSave.
Dim myAsmBuilder As AssemblyBuilder = myDomain.DefineDynamicAssembly(myAsmName, _
AssemblyBuilderAccess.RunAndSave)
' Generate a persistable, single-module assembly.
Dim myModBuilder As ModuleBuilder = _
myAsmBuilder.DefineDynamicModule(myAsmName.Name, myAsmName.Name & ".dll")
Dim myTypeBuilder As TypeBuilder = myModBuilder.DefineType("CustomerData", TypeAttributes.Public)
' Define a private field to hold the property value.
Dim customerNameBldr As FieldBuilder = myTypeBuilder.DefineField("customerName", _
GetType(String), FieldAttributes.Private)
' The last argument of DefineProperty is Nothing, because the
' property has no parameters. (If you don't specify Nothing, you must
' specify an array of Type objects. For a parameterless property,
' use an array with no elements: New Type() {})
Dim custNamePropBldr As PropertyBuilder = _
myTypeBuilder.DefineProperty("CustomerName", _
PropertyAttributes.HasDefault, _
GetType(String), _
Nothing)
' The property set and property get methods require a special
' set of attributes.
Dim getSetAttr As MethodAttributes = _
MethodAttributes.Public Or MethodAttributes.SpecialName _
Or MethodAttributes.HideBySig
' Define the "get" accessor method for CustomerName.
Dim custNameGetPropMthdBldr As MethodBuilder = _
myTypeBuilder.DefineMethod("GetCustomerName", _
getSetAttr, _
GetType(String), _
Type.EmptyTypes)
Dim custNameGetIL As ILGenerator = custNameGetPropMthdBldr.GetILGenerator()
custNameGetIL.Emit(OpCodes.Ldarg_0)
custNameGetIL.Emit(OpCodes.Ldfld, customerNameBldr)
custNameGetIL.Emit(OpCodes.Ret)
' Define the "set" accessor method for CustomerName.
Dim custNameSetPropMthdBldr As MethodBuilder = _
myTypeBuilder.DefineMethod("get_CustomerName", _
getSetAttr, _
Nothing, _
New Type() {GetType(String)})
Dim custNameSetIL As ILGenerator = custNameSetPropMthdBldr.GetILGenerator()
custNameSetIL.Emit(OpCodes.Ldarg_0)
custNameSetIL.Emit(OpCodes.Ldarg_1)
custNameSetIL.Emit(OpCodes.Stfld, customerNameBldr)
custNameSetIL.Emit(OpCodes.Ret)
' Last, we must map the two methods created above to our PropertyBuilder to
' their corresponding behaviors, "get" and "set" respectively.
custNamePropBldr.SetGetMethod(custNameGetPropMthdBldr)
custNamePropBldr.SetSetMethod(custNameSetPropMthdBldr)
Dim retval As Type = myTypeBuilder.CreateType()
' Save the assembly so it can be examined with Ildasm.exe,
' or referenced by a test program.
myAsmBuilder.Save(myAsmName.Name & ".dll")
return retval
End Function 'BuildDynamicTypeWithProperties
Public Shared Sub Main()
Dim custDataType As Type = BuildDynamicTypeWithProperties()
Dim custDataPropInfo As PropertyInfo() = custDataType.GetProperties()
Dim pInfo As PropertyInfo
For Each pInfo In custDataPropInfo
Console.WriteLine("Property '{0}' created!", pInfo.ToString())
Next pInfo
Console.WriteLine("---")
' Note that when invoking a property, you need to use the proper BindingFlags -
' BindingFlags.SetProperty when you invoke the "set" behavior, and
' BindingFlags.GetProperty when you invoke the "get" behavior. Also note that
' we invoke them based on the name we gave the property, as expected, and not
' the name of the methods we bound to the specific property behaviors.
Dim custData As Object = Activator.CreateInstance(custDataType)
custDataType.InvokeMember("CustomerName", BindingFlags.SetProperty, Nothing, _
custData, New Object() {"Joe User"})
Console.WriteLine("The customerName field of instance custData has been set to '{0}'.", _
custDataType.InvokeMember("CustomerName", BindingFlags.GetProperty, _
Nothing, custData, New Object() {}))
End Sub
End Class
' --- O U T P U T ---
' The output should be as follows:
' -------------------
' Property 'System.String CustomerName' created!
' ---
' The customerName field of instance custData has been set to 'Joe User'.
' -------------------
Comentários
Um PropertyBuilder é sempre associado a um TypeBuilder .A PropertyBuilder is always associated with a TypeBuilder. O TypeBuilder.The TypeBuilder. DefineProperty o método retornará um novo PropertyBuilder para um cliente.DefineProperty method will return a new PropertyBuilder to a client.
Construtores
| PropertyBuilder() |
Propriedades
| Attributes |
Obtém os atributos desta propriedade.Gets the attributes for this property. |
| CanRead |
Obtém um valor que indica se a propriedade pode ser lida.Gets a value indicating whether the property can be read. |
| CanWrite |
Obtém um valor que indica se a propriedade pode ser usada para gravação.Gets a value indicating whether the property can be written to. |
| CustomAttributes |
Obtém uma coleção que contém os atributos personalizados desse membro.Gets a collection that contains this member's custom attributes. (Herdado de MemberInfo) |
| DeclaringType |
Obtém a classe que declara esse membro.Gets the class that declares this member. |
| GetMethod |
Obtém o acessador |
| IsCollectible |
Obtém um valor que indica se este objeto MemberInfo faz parte de um assembly mantido em uma coleção AssemblyLoadContext.Gets a value that indicates whether this MemberInfo object is part of an assembly held in a collectible AssemblyLoadContext. (Herdado de MemberInfo) |
| IsSpecialName |
Obtém um valor que indica se a propriedade é o nome especial.Gets a value indicating whether the property is the special name. (Herdado de PropertyInfo) |
| MemberType |
Obtém um valor MemberTypes que indica que este membro é uma propriedade.Gets a MemberTypes value indicating that this member is a property. (Herdado de PropertyInfo) |
| MetadataToken |
Obtém um valor que identifica um elemento de metadados.Gets a value that identifies a metadata element. (Herdado de MemberInfo) |
| Module |
Obtém o módulo no qual o tipo que declara a propriedade atual está sendo definido.Gets the module in which the type that declares the current property is being defined. |
| Module |
Obtém o módulo no qual o tipo que declara o membro representado pelo MemberInfo atual está definido.Gets the module in which the type that declares the member represented by the current MemberInfo is defined. (Herdado de MemberInfo) |
| Name |
Obtém o nome desse membro.Gets the name of this member. |
| PropertyToken |
Recupera o token para essa propriedade.Retrieves the token for this property. |
| PropertyType |
Obtém o tipo do campo dessa propriedade.Gets the type of the field of this property. |
| ReflectedType |
Obtém o objeto de classe que foi usado para obter esta instância de |
| ReflectedType |
Obtém o objeto de classe que foi usado para obter esta instância de |
| SetMethod |
Obtém o acessador |
Métodos
| AddOtherMethod(MethodBuilder) |
Adiciona um dos outros métodos associados a essa propriedade.Adds one of the other methods associated with this property. |
| Equals(Object) |
Retorna um valor que indica se essa instância é igual a um objeto especificado.Returns a value that indicates whether this instance is equal to a specified object. (Herdado de PropertyInfo) |
| GetAccessors() |
Retorna uma matriz cujos elementos refletem os acessadores |
| GetAccessors(Boolean) |
Retorna uma matriz de acessadores |
| GetAccessors(Boolean) |
Retorna uma matriz cujos elementos refletem o público e, se especificado, acessadores |
| GetConstantValue() |
Retorna um valor literal associado à propriedade por um compilador.Returns a literal value associated with the property by a compiler. (Herdado de PropertyInfo) |
| GetCustomAttributes(Boolean) |
Retorna uma matriz de todos os atributos personalizados para essa propriedade.Returns an array of all the custom attributes for this property. |
| GetCustomAttributes(Boolean) |
Quando substituído em uma classe derivada, retorna uma matriz de todos os atributos personalizados aplicados a esse membro.When overridden in a derived class, returns an array of all custom attributes applied to this member. (Herdado de MemberInfo) |
| GetCustomAttributes(Type, Boolean) |
Retorna uma matriz de atributos personalizados identificados por Type.Returns an array of custom attributes identified by Type. |
| GetCustomAttributes(Type, Boolean) |
Quando substituído em uma classe derivada, retorna uma matriz de atributos personalizados aplicados a esse membro e identificados por Type.When overridden in a derived class, returns an array of custom attributes applied to this member and identified by Type. (Herdado de MemberInfo) |
| GetCustomAttributesData() |
Retorna uma lista de objetos CustomAttributeData que representam dados sobre os atributos que foram aplicados ao membro de destino.Returns a list of CustomAttributeData objects representing data about the attributes that have been applied to the target member. (Herdado de MemberInfo) |
| GetGetMethod() |
Retorna o acessador |
| GetGetMethod(Boolean) |
Retorna o acessador get público e não público para essa propriedade.Returns the public and non-public get accessor for this property. |
| GetGetMethod(Boolean) |
Quando substituído em uma classe derivada, retorna o acessador |
| GetHashCode() |
Retorna o código hash para a instância.Returns the hash code for this instance. (Herdado de PropertyInfo) |
| GetIndexParameters() |
Retorna uma matriz de todos os parâmetros de índice para a propriedade.Returns an array of all the index parameters for the property. |
| GetOptionalCustomModifiers() |
Retorna uma matriz de tipos que representam os modificadores personalizados opcionais da propriedade.Returns an array of types representing the optional custom modifiers of the property. (Herdado de PropertyInfo) |
| GetRawConstantValue() |
Retorna um valor literal associado à propriedade por um compilador.Returns a literal value associated with the property by a compiler. (Herdado de PropertyInfo) |
| GetRequiredCustomModifiers() |
Retorna uma matriz de tipos que representam os modificadores personalizados necessários da propriedade.Returns an array of types representing the required custom modifiers of the property. (Herdado de PropertyInfo) |
| GetSetMethod() |
Retorna o acessador |
| GetSetMethod(Boolean) |
Retorna o acessador set para essa propriedade.Returns the set accessor for this property. |
| GetSetMethod(Boolean) |
Quando substituído em uma classe derivada, retorna o acessador |
| GetType() |
Descobre os atributos de uma propriedade e fornece acesso aos parâmetros da propriedade.Discovers the attributes of a property and provides access to property metadata. (Herdado de PropertyInfo) |
| GetValue(Object) |
Retorna o valor da propriedade de um objeto especificado.Returns the property value of a specified object. (Herdado de PropertyInfo) |
| GetValue(Object, BindingFlags, Binder, Object[], CultureInfo) |
Obtém o valor de uma propriedade com a associação, o índice e o |
| GetValue(Object, BindingFlags, Binder, Object[], CultureInfo) |
Quando é substituído em uma classe derivada, retorna o valor da propriedade de um objeto especificado que tem as informações específicas da cultura, índice e associação especificadas.When overridden in a derived class, returns the property value of a specified object that has the specified binding, index, and culture-specific information. (Herdado de PropertyInfo) |
| GetValue(Object, Object[]) |
Obtém o valor da propriedade indexada chamando o método getter da propriedade.Gets the value of the indexed property by calling the property's getter method. |
| GetValue(Object, Object[]) |
Retorna o valor da propriedade de um objeto especificado com os valores de índice opcionais de propriedades indexadas.Returns the property value of a specified object with optional index values for indexed properties. (Herdado de PropertyInfo) |
| HasSameMetadataDefinitionAs(MemberInfo) | (Herdado de MemberInfo) |
| IsDefined(Type, Boolean) |
Indica se uma ou mais instância de |
| IsDefined(Type, Boolean) |
Quando substituído em uma classe derivada, indica se um ou mais atributos do tipo especificado ou de seus tipos derivados são aplicados a esse membro.When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. (Herdado de MemberInfo) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| SetConstant(Object) |
Define o valor padrão dessa propriedade.Sets the default value of this property. |
| SetCustomAttribute(ConstructorInfo, Byte[]) |
Define um atributo personalizado usando um blob de atributo personalizado especificado.Set a custom attribute using a specified custom attribute blob. |
| SetCustomAttribute(CustomAttributeBuilder) |
Defina um atributo personalizado usando um construtor de atributos personalizados.Set a custom attribute using a custom attribute builder. |
| SetGetMethod(MethodBuilder) |
Define o método que obtém o valor da propriedade.Sets the method that gets the property value. |
| SetSetMethod(MethodBuilder) |
Define o método que define o valor da propriedade.Sets the method that sets the property value. |
| SetValue(Object, Object) |
Define o valor da propriedade de um objeto especificado.Sets the property value of a specified object. (Herdado de PropertyInfo) |
| SetValue(Object, Object, BindingFlags, Binder, Object[], CultureInfo) |
Define o valor da propriedade para o objeto fornecido para o valor fornecido.Sets the property value for the given object to the given value. |
| SetValue(Object, Object, BindingFlags, Binder, Object[], CultureInfo) |
Quando é substituído em uma classe derivada, define o valor da propriedade de um objeto especificado que tem as informações específicas da cultura, índice e associação especificadas.When overridden in a derived class, sets the property value for a specified object that has the specified binding, index, and culture-specific information. (Herdado de PropertyInfo) |
| SetValue(Object, Object, Object[]) |
Define o valor da propriedade com valores de índice opcionais para propriedades do índice.Sets the value of the property with optional index values for index properties. |
| SetValue(Object, Object, Object[]) |
Define o valor da propriedade de um objeto especificado com valores de índice opcionais para as propriedades de índice.Sets the property value of a specified object with optional index values for index properties. (Herdado de PropertyInfo) |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |
Implantações explícitas de interface
| _MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Mapeia um conjunto de nomes para um conjunto correspondente de identificadores de expedição.Maps a set of names to a corresponding set of dispatch identifiers. (Herdado de MemberInfo) |
| _MemberInfo.GetType() |
Obtém um objeto Type que representa a classe MemberInfo.Gets a Type object representing the MemberInfo class. (Herdado de MemberInfo) |
| _MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera as informações do tipo de um objeto, que podem ser usadas para obter informações de tipo para uma interface.Retrieves the type information for an object, which can then be used to get the type information for an interface. (Herdado de MemberInfo) |
| _MemberInfo.GetTypeInfoCount(UInt32) |
Retorna o número de interfaces de informações do tipo que um objeto fornece (0 ou 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Herdado de MemberInfo) |
| _MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornece acesso a propriedades e métodos expostos por um objeto.Provides access to properties and methods exposed by an object. (Herdado de MemberInfo) |
| _PropertyBuilder.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Mapeia um conjunto de nomes para um conjunto correspondente de identificadores de expedição.Maps a set of names to a corresponding set of dispatch identifiers. |
| _PropertyBuilder.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera as informações do tipo de um objeto, que podem ser usadas para obter informações de tipo para uma interface.Retrieves the type information for an object, which can then be used to get the type information for an interface. |
| _PropertyBuilder.GetTypeInfoCount(UInt32) |
Retorna o número de interfaces de informações do tipo que um objeto fornece (0 ou 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1). |
| _PropertyBuilder.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornece acesso a propriedades e métodos expostos por um objeto.Provides access to properties and methods exposed by an object. |
| _PropertyInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Mapeia um conjunto de nomes para um conjunto correspondente de identificadores de expedição.Maps a set of names to a corresponding set of dispatch identifiers. (Herdado de PropertyInfo) |
| _PropertyInfo.GetType() |
Obtém um objeto Type que representa o tipo PropertyInfo.Gets a Type object representing the PropertyInfo type. (Herdado de PropertyInfo) |
| _PropertyInfo.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera as informações do tipo de um objeto, que podem ser usadas para obter informações de tipo para uma interface.Retrieves the type information for an object, which can then be used to get the type information for an interface. (Herdado de PropertyInfo) |
| _PropertyInfo.GetTypeInfoCount(UInt32) |
Retorna o número de interfaces de informações do tipo que um objeto fornece (0 ou 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Herdado de PropertyInfo) |
| _PropertyInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornece acesso a propriedades e métodos expostos por um objeto.Provides access to properties and methods exposed by an object. (Herdado de PropertyInfo) |
| ICustomAttributeProvider.GetCustomAttributes(Boolean) |
Retorna uma matriz de todos os atributos personalizados definidos neste membro, exceto atributos nomeados ou então uma matriz vazia, se não houver nenhum atributo personalizado.Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes. (Herdado de MemberInfo) |
| ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) |
Retorna uma matriz de atributos personalizados definidos neste membro, identificados por tipo ou então uma matriz vazia, se não houver nenhum atributo personalizado desse tipo.Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type. (Herdado de MemberInfo) |
| ICustomAttributeProvider.IsDefined(Type, Boolean) |
Indica se uma ou mais instâncias de |
Métodos de Extensão
| GetCustomAttribute(MemberInfo, Type) |
Recupera um atributo personalizado de um tipo especificado aplicado a um membro especificado.Retrieves a custom attribute of a specified type that is applied to a specified member. |
| GetCustomAttribute(MemberInfo, Type, Boolean) |
Recupera um atributo personalizado de um tipo especificado aplicado a um membro especificado e opcionalmente inspeciona os ancestrais desse membro.Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member. |
| GetCustomAttribute<T>(MemberInfo) |
Recupera um atributo personalizado de um tipo especificado aplicado a um membro especificado.Retrieves a custom attribute of a specified type that is applied to a specified member. |
| GetCustomAttribute<T>(MemberInfo, Boolean) |
Recupera um atributo personalizado de um tipo especificado aplicado a um membro especificado e opcionalmente inspeciona os ancestrais desse membro.Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member. |
| GetCustomAttributes(MemberInfo) |
Recupera uma coleção de atributos personalizados que são aplicados a um membro especificado.Retrieves a collection of custom attributes that are applied to a specified member. |
| GetCustomAttributes(MemberInfo, Boolean) |
Recupera uma coleção de atributos personalizados aplicado a um membro especificado e opcionalmente inspeciona os ancestrais desse membro.Retrieves a collection of custom attributes that are applied to a specified member, and optionally inspects the ancestors of that member. |
| GetCustomAttributes(MemberInfo, Type) |
Recupera uma coleção de atributos personalizados de um tipo especificado que são aplicados a um membro especificado.Retrieves a collection of custom attributes of a specified type that are applied to a specified member. |
| GetCustomAttributes(MemberInfo, Type, Boolean) |
Recupera uma coleção de atributos personalizados de um tipo especificado aplicado a um membro especificado e opcionalmente inspeciona os ancestrais desse membro.Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member. |
| GetCustomAttributes<T>(MemberInfo) |
Recupera uma coleção de atributos personalizados de um tipo especificado que são aplicados a um membro especificado.Retrieves a collection of custom attributes of a specified type that are applied to a specified member. |
| GetCustomAttributes<T>(MemberInfo, Boolean) |
Recupera uma coleção de atributos personalizados de um tipo especificado aplicado a um membro especificado e opcionalmente inspeciona os ancestrais desse membro.Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member. |
| IsDefined(MemberInfo, Type) |
Indica se os atributos personalizados de um tipo especificados são aplicados a um membro especificado.Indicates whether custom attributes of a specified type are applied to a specified member. |
| IsDefined(MemberInfo, Type, Boolean) |
Indica se os atributos personalizados de um tipo especificado são aplicados a um membro especificado e, opcionalmente, aplicados a seus ancestrais.Indicates whether custom attributes of a specified type are applied to a specified member, and, optionally, applied to its ancestors. |
| GetMetadataToken(MemberInfo) |
Obtém um token de metadados para o membro fornecido, se disponível.Gets a metadata token for the given member, if available. |
| HasMetadataToken(MemberInfo) |
Retorna um valor que indica se um token de metadados está disponível para o membro especificado.Returns a value that indicates whether a metadata token is available for the specified member. |
| GetAccessors(PropertyInfo) | |
| GetAccessors(PropertyInfo, Boolean) | |
| GetGetMethod(PropertyInfo) | |
| GetGetMethod(PropertyInfo, Boolean) | |
| GetSetMethod(PropertyInfo) | |
| GetSetMethod(PropertyInfo, Boolean) | |