Share via


CustomReflectionContext.CreateProperty Metodo

Definizione

Crea un oggetto che rappresenta una proprietà da aggiungere a un tipo, come specificato dal metodo AddProperties(Type).

Overload

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

Crea un oggetto che rappresenta una proprietà da aggiungere a un tipo, da utilizzare con il metodo AddProperties(Type).

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

Crea un oggetto che rappresenta una proprietà da aggiungere a un tipo, da utilizzare con il metodo AddProperties(Type) e utilizzando gli attributi personalizzati specificati.

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

Origine:
CustomReflectionContext.cs
Origine:
CustomReflectionContext.cs
Origine:
CustomReflectionContext.cs
Origine:
CustomReflectionContext.cs

Crea un oggetto che rappresenta una proprietà da aggiungere a un tipo, da utilizzare con il metodo 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

Parametri

propertyType
Type

Tipo di proprietà da creare.

name
String

Nome della proprietà da creare.

getter
Func<Object,Object>

Oggetto che rappresenta la funzione di accesso get alla proprietà.

setter
Action<Object,Object>

Oggetto che rappresenta la funzione di accesso set alla proprietà.

Restituisce

Oggetto che rappresenta la proprietà.

Commenti

Gli oggetti restituiti da questo metodo non sono oggetti completi PropertyInfo e devono essere usati solo nel contesto del AddProperties metodo.

Si applica a

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

Origine:
CustomReflectionContext.cs
Origine:
CustomReflectionContext.cs
Origine:
CustomReflectionContext.cs
Origine:
CustomReflectionContext.cs

Crea un oggetto che rappresenta una proprietà da aggiungere a un tipo, da utilizzare con il metodo AddProperties(Type) e utilizzando gli attributi personalizzati specificati.

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

Parametri

propertyType
Type

Tipo di proprietà da creare.

name
String

Nome della proprietà da creare.

getter
Func<Object,Object>

Oggetto che rappresenta la funzione di accesso get alla proprietà.

setter
Action<Object,Object>

Oggetto che rappresenta la funzione di accesso set alla proprietà.

propertyCustomAttributes
IEnumerable<Attribute>

Raccolta di attributi personalizzati da applicare alla proprietà.

getterCustomAttributes
IEnumerable<Attribute>

Raccolta di attributi personalizzati da applicare alla funzione di accesso get della proprietà.

setterCustomAttributes
IEnumerable<Attribute>

Raccolta di attributi personalizzati da applicare alla funzione di accesso set della proprietà.

Restituisce

Oggetto che rappresenta la proprietà.

Commenti

Gli oggetti restituiti da questo metodo non sono oggetti completi PropertyInfo e devono essere usati solo nel contesto del AddProperties metodo.

Si applica a