CustomReflectionContext.CreateProperty Metoda

Definicja

Tworzy obiekt, który reprezentuje właściwość, która ma zostać dodana do typu określonego przez metodę AddProperties(Type) .

Przeciążenia

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

Tworzy obiekt reprezentujący właściwość, która ma zostać dodana do typu, który ma być używany z AddProperties(Type) metodą .

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

Tworzy obiekt reprezentujący właściwość do dodania do typu, który ma być używany z AddProperties(Type) metodą i przy użyciu określonych atrybutów niestandardowych.

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

Źródło:
CustomReflectionContext.cs
Źródło:
CustomReflectionContext.cs
Źródło:
CustomReflectionContext.cs
Źródło:
CustomReflectionContext.cs

Tworzy obiekt reprezentujący właściwość, która ma zostać dodana do typu, który ma być używany z AddProperties(Type) metodą .

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 właściwości do utworzenia.

name
String

Nazwa właściwości do utworzenia.

getter
Func<Object,Object>

Delegat reprezentujący metodę dostępu właściwości get .

setter
Action<Object,Object>

Delegat reprezentujący metodę dostępu właściwości set .

Zwraca

Obiekt reprezentujący właściwość .

Uwagi

Obiekty zwracane przez tę metodę nie są kompletnymi PropertyInfo obiektami i powinny być używane tylko w kontekście AddProperties(Type) metody .

Dotyczy

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

Źródło:
CustomReflectionContext.cs
Źródło:
CustomReflectionContext.cs
Źródło:
CustomReflectionContext.cs
Źródło:
CustomReflectionContext.cs

Tworzy obiekt reprezentujący właściwość do dodania do typu, który ma być używany z AddProperties(Type) metodą i przy użyciu określonych atrybutów niestandardowych.

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 właściwości do utworzenia.

name
String

Nazwa właściwości do utworzenia.

getter
Func<Object,Object>

Delegat reprezentujący metodę dostępu właściwości get .

setter
Action<Object,Object>

Delegat reprezentujący metodę dostępu właściwości set .

propertyCustomAttributes
IEnumerable<Attribute>

Kolekcja atrybutów niestandardowych, które mają być stosowane do właściwości.

getterCustomAttributes
IEnumerable<Attribute>

Kolekcja atrybutów niestandardowych, które mają być stosowane do metody dostępu właściwości get .

setterCustomAttributes
IEnumerable<Attribute>

Kolekcja atrybutów niestandardowych, które mają być stosowane do metody dostępu właściwości set .

Zwraca

Obiekt reprezentujący właściwość .

Uwagi

Obiekty zwracane przez tę metodę nie są kompletnymi PropertyInfo obiektami i powinny być używane tylko w kontekście AddProperties(Type) metody .

Dotyczy