CustomReflectionContext.CreateProperty Metódus

Definíció

Létrehoz egy objektumot, amely egy típushoz hozzáadandó tulajdonságot jelöl a AddProperties(Type) metódus által megadott módon.

Túlterhelések

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

Létrehoz egy objektumot, amely egy típushoz hozzáadandó tulajdonságot jelöl, amelyet a AddProperties(Type) metódussal kell használni.

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

Létrehoz egy objektumot, amely egy típushoz hozzáadandó tulajdonságot jelöl, amelyet a AddProperties(Type) metódussal és a megadott egyéni attribútumokkal kell használni.

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

Létrehoz egy objektumot, amely egy típushoz hozzáadandó tulajdonságot jelöl, amelyet a AddProperties(Type) metódussal kell használni.

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);
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

Paraméterek

propertyType
Type

A létrehozandó tulajdonság típusa.

name
String

A létrehozandó tulajdonság neve.

getter
Func<Object,Object>

A tulajdonság tartozékát get képviselő objektum.

setter
Action<Object,Object>

A tulajdonság tartozékát set képviselő objektum.

Válaszok

A tulajdonságot jelképező objektum.

Megjegyzések

A metódus által visszaadott objektumok nem teljes PropertyInfo objektumok, és csak a metódus kontextusában AddProperties használhatók.

A következőre érvényes:

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

Létrehoz egy objektumot, amely egy típushoz hozzáadandó tulajdonságot jelöl, amelyet a AddProperties(Type) metódussal és a megadott egyéni attribútumokkal kell használni.

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);
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

Paraméterek

propertyType
Type

A létrehozandó tulajdonság típusa.

name
String

A létrehozandó tulajdonság neve.

getter
Func<Object,Object>

A tulajdonság tartozékát get képviselő objektum.

setter
Action<Object,Object>

A tulajdonság tartozékát set képviselő objektum.

propertyCustomAttributes
IEnumerable<Attribute>

A tulajdonságra alkalmazandó egyéni attribútumok gyűjteménye.

getterCustomAttributes
IEnumerable<Attribute>

A tulajdonság get tartozékára alkalmazandó egyéni attribútumok gyűjteménye.

setterCustomAttributes
IEnumerable<Attribute>

A tulajdonság set tartozékára alkalmazandó egyéni attribútumok gyűjteménye.

Válaszok

A tulajdonságot jelképező objektum.

Megjegyzések

A metódus által visszaadott objektumok nem teljes PropertyInfo objektumok, és csak a metódus kontextusában AddProperties használhatók.

A következőre érvényes: