Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Defining a Property With Reflection Emit 

A property is defined using the TypeBuilder.DefineProperty method. DefineProperty returns a PropertyBuilder. The DefineProperty method requires the caller to specify the property name, the signature of the property, the property attributes (using the PropertyAttributes enumeration), and the backing field.

The PropertyBuilder class allows the caller to specify the getter method, the setter method, and any other methods.

The default value of the property can be set using PropertyBuilder.SetConstant.

See Also

Other Resources

Using Reflection Emit

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.