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

.NET Framework 4.5

Creates an object that represents a property to be added to a type, to be used with the AddProperties method and using the specified custom attributes.

Namespace:  System.Reflection.Context
Assembly:  System.Reflection.Context (in System.Reflection.Context.dll)

protected PropertyInfo CreateProperty(
	Type propertyType,
	string name,
	Func<Object, Object> getter,
	Action<Object, Object> setter,
	IEnumerable<Attribute> propertyCustomAttributes,
	IEnumerable<Attribute> getterCustomAttributes,
	IEnumerable<Attribute> setterCustomAttributes
)

Parameters

propertyType
Type: System.Type

The type of the property to create.

name
Type: System.String

The name of the property to create.

getter
Type: System.Func<Object, Object>

An object that represents the property's get accessor.

setter
Type: System.Action<Object, Object>

An object that represents the property's set accessor.

propertyCustomAttributes
Type: System.Collections.Generic.IEnumerable<Attribute>

A collection of custom attributes to apply to the property.

getterCustomAttributes
Type: System.Collections.Generic.IEnumerable<Attribute>

A collection of custom attributes to apply to the property's get accessor.

setterCustomAttributes
Type: System.Collections.Generic.IEnumerable<Attribute>

A collection of custom attributes to apply to the property's set accessor.

Return Value

Type: System.Reflection.PropertyInfo
An object that represents the property.

Objects that are returned by this method are not complete PropertyInfo objects, and should be used only in the context of the AddProperties method.

.NET Framework

Supported in: 4.6, 4.5

.NET for Windows Store apps

Supported in: Windows 8

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft