Class PropertyBuildInfo
Contains information about the construction of a property.
Inherited Members
Namespace: TheXDS.MCART.Types
Assembly: MCART.TypeFactory.dll
Syntax
public class PropertyBuildInfo : MemberBuildInfo<PropertyBuilder>
Constructors
| Edit this page View SourcePropertyBuildInfo(TypeBuilder, PropertyBuilder, FieldBuilder)
Initializes a new instance of the PropertyBuildInfo class.
Declaration
public PropertyBuildInfo(TypeBuilder typeBuilder, PropertyBuilder property, FieldBuilder field)
Parameters
| Type | Name | Description |
|---|---|---|
| TypeBuilder | typeBuilder | The TypeBuilder instance where the property was defined. |
| PropertyBuilder | property | The PropertyBuilder that describes the property that has been created. |
| FieldBuilder | field | The backing field defined for the property. |
PropertyBuildInfo(TypeBuilder, PropertyBuilder, ILGenerator)
Initializes a new instance of the PropertyBuildInfo class.
Declaration
public PropertyBuildInfo(TypeBuilder typeBuilder, PropertyBuilder property, ILGenerator getter)
Parameters
| Type | Name | Description |
|---|---|---|
| TypeBuilder | typeBuilder | The TypeBuilder instance where the property was defined. |
| PropertyBuilder | property | The PropertyBuilder that describes the property that has been created. |
| ILGenerator | getter | The ILGenerator that allows the code for the property's get block to be defined. |
PropertyBuildInfo(TypeBuilder, PropertyBuilder, ILGenerator?, ILGenerator?)
Initializes a new instance of the PropertyBuildInfo class.
Declaration
public PropertyBuildInfo(TypeBuilder typeBuilder, PropertyBuilder property, ILGenerator? getter, ILGenerator? setter)
Parameters
| Type | Name | Description |
|---|---|---|
| TypeBuilder | typeBuilder | Instance of TypeBuilder where the property was defined. |
| PropertyBuilder | property | PropertyBuilder that describes the property that has been created. |
| ILGenerator | getter | ILGenerator that allows the code for the property's get block to be defined. |
| ILGenerator | setter | ILGenerator that allows the code for the property's set block to be defined. |
Properties
| Edit this page View SourceField
Reference to the FieldBuilder used to create the backing field for the property, if one is employed.
Declaration
public FieldBuilder? Field { get; }
Property Value
| Type | Description |
|---|---|
| FieldBuilder | The FieldBuilder of the backing field, or null if the property does not use a field to store its current value. |
Getter
Reference to the ILGenerator of the property's get method.
Declaration
public ILGenerator? Getter { get; }
Property Value
| Type | Description |
|---|---|
| ILGenerator | An ILGenerator that can be used to define the property's get method, or null if the property is auto‑implemented or if the property has no get method. |
Setter
Reference to the ILGenerator of the property's set method.
Declaration
public ILGenerator? Setter { get; }
Property Value
| Type | Description |
|---|---|
| ILGenerator | An ILGenerator that can be used to define the property's set method, or null if the property is auto‑implemented or if the property has no set method. |
Methods
| Edit this page View SourceCreate(TypeBuilder, string, Type, bool, MemberAccess, bool)
Creates a property in the type with no get or set implementations initially defined.
Declaration
public static PropertyBuildInfo Create(TypeBuilder tb, string name, Type type, bool writable, MemberAccess access, bool @virtual)
Parameters
| Type | Name | Description |
|---|---|---|
| TypeBuilder | tb | Type builder in which to create the new property. |
| string | name | Name of the new property. |
| Type | type | Type of the new property. |
| bool | writable | true to create a property that contains a write accessor (set accessor); false to omit a write accessor. |
| MemberAccess | access | Access level of the new property. |
| bool | virtual | If true, the property is defined as virtual, allowing it to be overridden in a derived class. |
Returns
| Type | Description |
|---|---|
| PropertyBuildInfo | A PropertyBuildInfo that contains information about the constructed property. |
Remarks
The generated property will require the accessors to be implemented before the type is created.
CreateWriteOnly(TypeBuilder, string, Type, MemberAccess, bool)
Creates a write‑only property in the type.
Declaration
public static PropertyBuildInfo CreateWriteOnly(TypeBuilder tb, string name, Type type, MemberAccess access, bool @virtual)
Parameters
| Type | Name | Description |
|---|---|---|
| TypeBuilder | tb | Type builder in which to create the new property. |
| string | name | Name of the new property. |
| Type | type | Type of the new property. |
| MemberAccess | access | Access level of the new property. |
| bool | virtual | If true, the property is defined as virtual and can be overridden in a derived class. |
Returns
| Type | Description |
|---|---|
| PropertyBuildInfo | A PropertyBuildInfo that contains information about the constructed property. |
Operators
| Edit this page View Sourceimplicit operator FieldInfo?(PropertyBuildInfo)
Implicitly converts a PropertyBuildInfo to a FieldInfo.
Declaration
public static implicit operator FieldInfo?(PropertyBuildInfo buildInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyBuildInfo | buildInfo | The PropertyBuildInfo from which to extract the FieldInfo. |
Returns
| Type | Description |
|---|---|
| FieldInfo |