Compartir a través de


CustomReflectionContext.CreateProperty Método

Definición

Crea un objeto que representa una propiedad que se va a agregar a un tipo, tal como especifica el método AddProperties(Type).

Sobrecargas

CreateProperty(Type, String, Func<Object,Object>, Action<Object,Object>)

Crea un objeto que representa una propiedad que se va a agregar a un tipo y que se va a utilizar con el método AddProperties(Type).

CreateProperty(Type, String, Func<Object,Object>, Action<Object,Object>, IEnumerable<Attribute>, IEnumerable<Attribute>, IEnumerable<Attribute>)

Crea un objeto que representa una propiedad que se va a agregar a un tipo y que se va a utilizar con el método AddProperties(Type) usando los atributos personalizados especificados.

CreateProperty(Type, String, Func<Object,Object>, Action<Object,Object>)

Source:
CustomReflectionContext.cs
Source:
CustomReflectionContext.cs
Source:
CustomReflectionContext.cs
Source:
CustomReflectionContext.cs

Crea un objeto que representa una propiedad que se va a agregar a un tipo y que se va a utilizar con el método AddProperties(Type).

protected:
 System::Reflection::PropertyInfo ^ CreateProperty(Type ^ propertyType, System::String ^ name, Func<System::Object ^, System::Object ^> ^ getter, Action<System::Object ^, System::Object ^> ^ setter);
protected System.Reflection.PropertyInfo CreateProperty (Type propertyType, string name, Func<object,object> getter, Action<object,object> setter);
protected System.Reflection.PropertyInfo CreateProperty (Type propertyType, string name, Func<object,object?>? getter, Action<object,object?>? setter);
member this.CreateProperty : Type * string * Func<obj, obj> * Action<obj, obj> -> System.Reflection.PropertyInfo
Protected Function CreateProperty (propertyType As Type, name As String, getter As Func(Of Object, Object), setter As Action(Of Object, Object)) As PropertyInfo

Parámetros

propertyType
Type

Tipo de la propiedad que se va a crear.

name
String

Nombre de la propiedad que se va a crear.

getter
Func<Object,Object>

Objeto que representa el descriptor de acceso get de la propiedad.

setter
Action<Object,Object>

Objeto que representa el descriptor de acceso set de la propiedad.

Devoluciones

Objeto que representa la propiedad.

Comentarios

Los objetos devueltos por este método no son objetos completos PropertyInfo y solo se deben usar en el contexto del AddProperties método .

Se aplica a

CreateProperty(Type, String, Func<Object,Object>, Action<Object,Object>, IEnumerable<Attribute>, IEnumerable<Attribute>, IEnumerable<Attribute>)

Source:
CustomReflectionContext.cs
Source:
CustomReflectionContext.cs
Source:
CustomReflectionContext.cs
Source:
CustomReflectionContext.cs

Crea un objeto que representa una propiedad que se va a agregar a un tipo y que se va a utilizar con el método AddProperties(Type) usando los atributos personalizados especificados.

protected:
 System::Reflection::PropertyInfo ^ CreateProperty(Type ^ propertyType, System::String ^ name, Func<System::Object ^, System::Object ^> ^ getter, Action<System::Object ^, System::Object ^> ^ setter, System::Collections::Generic::IEnumerable<Attribute ^> ^ propertyCustomAttributes, System::Collections::Generic::IEnumerable<Attribute ^> ^ getterCustomAttributes, System::Collections::Generic::IEnumerable<Attribute ^> ^ setterCustomAttributes);
protected System.Reflection.PropertyInfo CreateProperty (Type propertyType, string name, Func<object,object> getter, Action<object,object> setter, System.Collections.Generic.IEnumerable<Attribute> propertyCustomAttributes, System.Collections.Generic.IEnumerable<Attribute> getterCustomAttributes, System.Collections.Generic.IEnumerable<Attribute> setterCustomAttributes);
protected System.Reflection.PropertyInfo CreateProperty (Type propertyType, string name, Func<object,object?>? getter, Action<object,object?>? setter, System.Collections.Generic.IEnumerable<Attribute>? propertyCustomAttributes, System.Collections.Generic.IEnumerable<Attribute>? getterCustomAttributes, System.Collections.Generic.IEnumerable<Attribute>? setterCustomAttributes);
member this.CreateProperty : Type * string * Func<obj, obj> * Action<obj, obj> * seq<Attribute> * seq<Attribute> * seq<Attribute> -> System.Reflection.PropertyInfo
Protected Function CreateProperty (propertyType As Type, name As String, getter As Func(Of Object, Object), setter As Action(Of Object, Object), propertyCustomAttributes As IEnumerable(Of Attribute), getterCustomAttributes As IEnumerable(Of Attribute), setterCustomAttributes As IEnumerable(Of Attribute)) As PropertyInfo

Parámetros

propertyType
Type

Tipo de la propiedad que se va a crear.

name
String

Nombre de la propiedad que se va a crear.

getter
Func<Object,Object>

Objeto que representa el descriptor de acceso get de la propiedad.

setter
Action<Object,Object>

Objeto que representa el descriptor de acceso set de la propiedad.

propertyCustomAttributes
IEnumerable<Attribute>

Colección de atributos personalizados para aplicar a la propiedad.

getterCustomAttributes
IEnumerable<Attribute>

Colección de atributos personalizados para aplicar el descriptor de acceso get de la propiedad.

setterCustomAttributes
IEnumerable<Attribute>

Colección de atributos personalizados para aplicar el descriptor de acceso set de la propiedad.

Devoluciones

Objeto que representa la propiedad.

Comentarios

Los objetos devueltos por este método no son objetos completos PropertyInfo y solo se deben usar en el contexto del AddProperties método .

Se aplica a