Class Field<TValue>
Provides typed access to static field declared in type TValue.
Inherited Members
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public sealed class Field<TValue> : FieldBase<TValue>, IEquatable<FieldInfo>, IField<TValue>, IField, IMember<FieldInfo>, ICustomAttributeProviderType Parameters
| Name | Description | 
|---|---|
| TValue | Type of field value. | 
Properties
| Improve this Doc View SourceValue
Obtains managed pointer to the static field.
Declaration
public TValue Value { get; }Property Value
| Type | Description | 
|---|---|
| TValue | The managed pointer to the static field. | 
Methods
| Improve this Doc View SourceGetValue(Object)
Returns the value of a field supported by a given object.
Declaration
public override object GetValue(object obj)Parameters
| Type | Name | Description | 
|---|---|---|
| Object | obj | Must be null. | 
Returns
| Type | Description | 
|---|---|
| Object | An object containing the value of the field reflected by this instance. | 
Overrides
GetValue(Object, out TValue)
Returns the value of a field supported by a given object.
Declaration
public override bool GetValue(object obj, out TValue value)Parameters
| Type | Name | Description | 
|---|---|---|
| Object | obj | Must be null. | 
| TValue | value | An object containing the value of the field reflected by this instance. | 
Returns
| Type | Description | 
|---|---|
| Boolean | true, if field value is obtained successfully; otherwise, false. | 
Overrides
SetValue(Object, TValue)
Sets the value of the field supported by the given object.
Declaration
public override bool SetValue(object obj, TValue value)Parameters
| Type | Name | Description | 
|---|---|---|
| Object | obj | Must be null. | 
| TValue | value | The value to assign to the field. | 
Returns
| Type | Description | 
|---|---|
| Boolean | true, if field value is modified successfully; otherwise, false. | 
Overrides
SetValue(Object, Object, BindingFlags, Binder, CultureInfo)
Sets the value of the field supported by the given object.
Declaration
public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)Parameters
| Type | Name | Description | 
|---|---|---|
| Object | obj | Must be null. | 
| Object | value | The value to assign to the field. | 
| BindingFlags | invokeAttr | The type of binding that is desired. | 
| Binder | binder | A set of properties that enables the binding, coercion of argument types, and invocation of members through reflection. | 
| CultureInfo | culture | The software preferences of a particular culture. | 
Overrides
Operators
| Improve this Doc View SourceImplicit(Field<TValue> to MemberGetter<TValue>)
Obtains field getter in the form of the delegate instance.
Declaration
public static implicit operator MemberGetter<TValue>(Field<TValue> field)Parameters
| Type | Name | Description | 
|---|---|---|
| Field<TValue> | field | The reflected field. | 
Returns
| Type | Description | 
|---|---|
| MemberGetter<TValue> | 
Implicit(Field<TValue> to MemberSetter<TValue>)
Obtains field setter in the form of the delegate instance.
Declaration
public static implicit operator MemberSetter<TValue>(Field<TValue> field)Parameters
| Type | Name | Description | 
|---|---|---|
| Field<TValue> | field | The reflected field. | 
Returns
| Type | Description | 
|---|---|
| MemberSetter<TValue> |