CustomReflectionContext.CreateProperty Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Vytvoří objekt, který představuje vlastnost, která má být přidána do typu, jak je určena metodou AddProperties(Type) .
Přetížení
| Name | Description |
|---|---|
| CreateProperty(Type, String, Func<Object,Object>, Action<Object,Object>) |
Vytvoří objekt, který představuje vlastnost, která se má přidat k typu, která se má použít s metodou AddProperties(Type) . |
| CreateProperty(Type, String, Func<Object,Object>, Action<Object,Object>, IEnumerable<Attribute>, IEnumerable<Attribute>, IEnumerable<Attribute>) |
Vytvoří objekt, který představuje vlastnost, která se má přidat do typu, která se má použít s metodou AddProperties(Type) a pomocí zadaných vlastních atributů. |
CreateProperty(Type, String, Func<Object,Object>, Action<Object,Object>)
Vytvoří objekt, který představuje vlastnost, která se má přidat k typu, která se má použít s metodou 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
Parametry
- propertyType
- Type
Typ vlastnosti, která se má vytvořit.
- name
- String
Název vlastnosti, která se má vytvořit.
Návraty
Objekt, který představuje vlastnost.
Poznámky
Objekty vrácené touto metodou nejsou kompletní PropertyInfo objekty a měly by být použity pouze v kontextu AddProperties(Type) metody.
Platí pro
CreateProperty(Type, String, Func<Object,Object>, Action<Object,Object>, IEnumerable<Attribute>, IEnumerable<Attribute>, IEnumerable<Attribute>)
Vytvoří objekt, který představuje vlastnost, která se má přidat do typu, která se má použít s metodou AddProperties(Type) a pomocí zadaných vlastních atributů.
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
Parametry
- propertyType
- Type
Typ vlastnosti, která se má vytvořit.
- name
- String
Název vlastnosti, která se má vytvořit.
- propertyCustomAttributes
- IEnumerable<Attribute>
Kolekce vlastních atributů, které se mají použít na vlastnost.
- getterCustomAttributes
- IEnumerable<Attribute>
Kolekce vlastních atributů, které se mají použít u přístupového objektu get vlastnosti.
- setterCustomAttributes
- IEnumerable<Attribute>
Kolekce vlastních atributů, které se mají použít u přístupového objektu set vlastnosti.
Návraty
Objekt, který představuje vlastnost.
Poznámky
Objekty vrácené touto metodou nejsou kompletní PropertyInfo objekty a měly by být použity pouze v kontextu AddProperties(Type) metody.