CustomReflectionContext.CreateProperty Метод

Определение

Создает объект, представляющий свойство, добавляемое в тип, как указано методом AddProperties(Type) .

Перегрузки

Имя Описание
CreateProperty(Type, String, Func<Object,Object>, Action<Object,Object>)

Создает объект, представляющий свойство, добавляемое в тип, для использования с методом AddProperties(Type) .

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

Создает объект, представляющий свойство, добавляемое в тип, для использования с AddProperties(Type) методом и использования заданных настраиваемых атрибутов.

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

Исходный код:
CustomReflectionContext.cs
Исходный код:
CustomReflectionContext.cs
Исходный код:
CustomReflectionContext.cs
Исходный код:
CustomReflectionContext.cs

Создает объект, представляющий свойство, добавляемое в тип, для использования с методом 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

Параметры

propertyType
Type

Тип создаваемого свойства.

name
String

Имя создаваемого свойства.

getter
Func<Object,Object>

Делегат, представляющий метод доступа свойства get .

setter
Action<Object,Object>

Делегат, представляющий метод доступа свойства set .

Возвращаемое значение

Объект, представляющий свойство.

Комментарии

Объекты, возвращаемые этим методом, не являются полными PropertyInfo объектами и должны использоваться только в контексте AddProperties(Type) метода.

Применяется к

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

Исходный код:
CustomReflectionContext.cs
Исходный код:
CustomReflectionContext.cs
Исходный код:
CustomReflectionContext.cs
Исходный код:
CustomReflectionContext.cs

Создает объект, представляющий свойство, добавляемое в тип, для использования с AddProperties(Type) методом и использования заданных настраиваемых атрибутов.

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

Параметры

propertyType
Type

Тип создаваемого свойства.

name
String

Имя создаваемого свойства.

getter
Func<Object,Object>

Делегат, представляющий метод доступа свойства get .

setter
Action<Object,Object>

Делегат, представляющий метод доступа свойства set .

propertyCustomAttributes
IEnumerable<Attribute>

Коллекция настраиваемых атрибутов для применения к свойству.

getterCustomAttributes
IEnumerable<Attribute>

Коллекция настраиваемых атрибутов для применения к методу доступа свойства get .

setterCustomAttributes
IEnumerable<Attribute>

Коллекция настраиваемых атрибутов для применения к методу доступа свойства set .

Возвращаемое значение

Объект, представляющий свойство.

Комментарии

Объекты, возвращаемые этим методом, не являются полными PropertyInfo объектами и должны использоваться только в контексте AddProperties(Type) метода.

Применяется к