CustomReflectionContext.CreateProperty Metódus
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
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.
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.
- 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.