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 метода .

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

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 метода .

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