Class FieldExtensions
Extends FieldInfo class.
Inherited Members
Namespace: DotNext.Reflection
Assembly: DotNext.dll
Syntax
public static class FieldExtensions
Methods
View SourceFromField(object, FieldInfo)
Returns a reference to the field.
Declaration
public static Variant FromField(object owner, FieldInfo field)
Parameters
| Type | Name | Description |
|---|---|---|
| object | owner | The object which contains a field. |
| FieldInfo | field | The field reference. |
Returns
| Type | Description |
|---|---|
| Variant | Location of the field value. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentException |
|
GetValue<T>(FieldInfo, object)
Gets value of the field.
Declaration
public static ref T GetValue<T>(this FieldInfo field, object owner) where T : notnull
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInfo | field | |
| object | owner | The field owner. |
Returns
| Type | Description |
|---|---|
| T | The field location. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the field. |