CustomReflectionContext.CreateProperty Metod

Definition

Skapar ett objekt som representerar en egenskap som ska läggas till i en typ, enligt metodens angiven AddProperties(Type) .

Överlagringar

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

Skapar ett objekt som representerar en egenskap som ska läggas till i en typ som ska användas med AddProperties(Type) metoden.

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

Skapar ett objekt som representerar en egenskap som ska läggas till i en typ, som ska användas med AddProperties(Type) metoden och med hjälp av de angivna anpassade attributen.

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

Källa:
CustomReflectionContext.cs
Källa:
CustomReflectionContext.cs
Källa:
CustomReflectionContext.cs
Källa:
CustomReflectionContext.cs

Skapar ett objekt som representerar en egenskap som ska läggas till i en typ som ska användas med AddProperties(Type) metoden.

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

Parametrar

propertyType
Type

Typen av egenskap som ska skapas.

name
String

Namnet på den egenskap som ska skapas.

getter
Func<Object,Object>

Ett ombud som representerar egenskapens get accessor.

setter
Action<Object,Object>

Ett ombud som representerar egenskapens set accessor.

Returer

Ett objekt som representerar egenskapen.

Kommentarer

Objekt som returneras av den här metoden är inte fullständiga PropertyInfo objekt och bör endast användas i metodens AddProperties(Type) kontext.

Gäller för

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

Källa:
CustomReflectionContext.cs
Källa:
CustomReflectionContext.cs
Källa:
CustomReflectionContext.cs
Källa:
CustomReflectionContext.cs

Skapar ett objekt som representerar en egenskap som ska läggas till i en typ, som ska användas med AddProperties(Type) metoden och med hjälp av de angivna anpassade attributen.

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

Parametrar

propertyType
Type

Typen av egenskap som ska skapas.

name
String

Namnet på den egenskap som ska skapas.

getter
Func<Object,Object>

Ett ombud som representerar egenskapens get accessor.

setter
Action<Object,Object>

Ett ombud som representerar egenskapens set accessor.

propertyCustomAttributes
IEnumerable<Attribute>

En samling anpassade attribut som ska tillämpas på egenskapen.

getterCustomAttributes
IEnumerable<Attribute>

En samling anpassade attribut som ska tillämpas på egenskapens get accessor.

setterCustomAttributes
IEnumerable<Attribute>

En samling anpassade attribut som ska tillämpas på egenskapens set accessor.

Returer

Ett objekt som representerar egenskapen.

Kommentarer

Objekt som returneras av den här metoden är inte fullständiga PropertyInfo objekt och bör endast användas i metodens AddProperties(Type) kontext.

Gäller för