Show / Hide Table of Contents

Class FieldBase<TValue>

Represents reflected field.

Inheritance
Object
MemberInfo
FieldInfo
FieldBase<TValue>
Field<TValue>
Field<T, TValue>
Implements
IField
IMember<FieldInfo>
ICustomAttributeProvider
IEquatable<FieldInfo>
Inherited Members
FieldInfo.GetFieldFromHandle(RuntimeFieldHandle)
FieldInfo.GetFieldFromHandle(RuntimeFieldHandle, RuntimeTypeHandle)
FieldInfo.SetValue(Object, Object)
FieldInfo.IsAssembly
FieldInfo.IsFamily
FieldInfo.IsFamilyAndAssembly
FieldInfo.IsFamilyOrAssembly
FieldInfo.IsInitOnly
FieldInfo.IsLiteral
FieldInfo.IsNotSerialized
FieldInfo.IsPinvokeImpl
FieldInfo.IsPrivate
FieldInfo.IsPublic
FieldInfo.IsSpecialName
FieldInfo.IsStatic
MemberInfo.HasSameMetadataDefinitionAs(MemberInfo)
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public abstract class FieldBase<TValue> : FieldInfo, IField, IMember<FieldInfo>, ICustomAttributeProvider, IEquatable<FieldInfo>
Type Parameters
Name Description
TValue

Type of field value.

Properties

| Improve this Doc View Source

Attributes

Gets the attributes associated with this field.

Declaration
public override sealed FieldAttributes Attributes { get; }
Property Value
Type Description
FieldAttributes
Overrides
FieldInfo.Attributes
| Improve this Doc View Source

CustomAttributes

Gets a collection that contains this member's custom attributes.

Declaration
public override sealed IEnumerable<CustomAttributeData> CustomAttributes { get; }
Property Value
Type Description
IEnumerable<CustomAttributeData>
Overrides
MemberInfo.CustomAttributes
| Improve this Doc View Source

DeclaringType

Gets the class that declares this field.

Declaration
public override sealed Type DeclaringType { get; }
Property Value
Type Description
Type
Overrides
MemberInfo.DeclaringType
| Improve this Doc View Source

FieldHandle

Gets a handle to the internal metadata representation of this field.

Declaration
public override sealed RuntimeFieldHandle FieldHandle { get; }
Property Value
Type Description
RuntimeFieldHandle
Overrides
FieldInfo.FieldHandle
| Improve this Doc View Source

FieldType

Gets type of this field.

Declaration
public override sealed Type FieldType { get; }
Property Value
Type Description
Type
Overrides
FieldInfo.FieldType
| Improve this Doc View Source

IsReadOnly

Determines whether this field is read-only and cannot be modified.

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsSecurityCritical

Gets a value that indicates whether the field is security-critical or security-safe-critical at the current trust level, and therefore can perform critical operations.

Declaration
public override sealed bool IsSecurityCritical { get; }
Property Value
Type Description
Boolean
Overrides
FieldInfo.IsSecurityCritical
| Improve this Doc View Source

IsSecuritySafeCritical

Gets a value that indicates whether the field is security-safe-critical at the current trust level; that is, whether it can perform critical operations and can be accessed by transparent code.

Declaration
public override sealed bool IsSecuritySafeCritical { get; }
Property Value
Type Description
Boolean
Overrides
FieldInfo.IsSecuritySafeCritical
| Improve this Doc View Source

IsSecurityTransparent

Gets a value that indicates whether the current field is transparent at the current trust level, and therefore cannot perform critical operations.

Declaration
public override sealed bool IsSecurityTransparent { get; }
Property Value
Type Description
Boolean
Overrides
FieldInfo.IsSecurityTransparent
| Improve this Doc View Source

MemberType

Always returns Field.

Declaration
public override sealed MemberTypes MemberType { get; }
Property Value
Type Description
MemberTypes
Overrides
FieldInfo.MemberType
| Improve this Doc View Source

MetadataToken

Gets a value that identifies a metadata element.

Declaration
public override sealed int MetadataToken { get; }
Property Value
Type Description
Int32
Overrides
MemberInfo.MetadataToken
| Improve this Doc View Source

Module

Gets the module in which the type that declares the field represented by the current instance is defined.

Declaration
public override sealed Module Module { get; }
Property Value
Type Description
Module
Overrides
MemberInfo.Module
| Improve this Doc View Source

Name

Gets name of the field.

Declaration
public override sealed string Name { get; }
Property Value
Type Description
String
Overrides
MemberInfo.Name
| Improve this Doc View Source

ReflectedType

Gets the class object that was used to obtain this instance.

Declaration
public override sealed Type ReflectedType { get; }
Property Value
Type Description
Type
Overrides
MemberInfo.ReflectedType

Methods

| Improve this Doc View Source

Equals(Object)

Determines whether this field is equal to the given field.

Declaration
public override sealed bool Equals(object other)
Parameters
Type Name Description
Object other

Other field to compare.

Returns
Type Description
Boolean

true if this object reflects the same field as the specified object; otherwise, false.

Overrides
FieldInfo.Equals(Object)
| Improve this Doc View Source

Equals(FieldInfo)

Determines whether this field is equal to the given field.

Declaration
public bool Equals(FieldInfo other)
Parameters
Type Name Description
FieldInfo other

Other field to compare.

Returns
Type Description
Boolean

true if this object reflects the same field as the specified object; otherwise, false.

| Improve this Doc View Source

GetCustomAttributes(Boolean)

Returns an array of all custom attributes applied to this field.

Declaration
public override sealed object[] GetCustomAttributes(bool inherit)
Parameters
Type Name Description
Boolean inherit

true to search this member's inheritance chain to find the attributes; otherwise, false.

Returns
Type Description
Object[]

An array that contains all the custom attributes applied to this field.

Overrides
MemberInfo.GetCustomAttributes(Boolean)
| Improve this Doc View Source

GetCustomAttributes(Type, Boolean)

Returns an array of all custom attributes applied to this field.

Declaration
public override sealed object[] GetCustomAttributes(Type attributeType, bool inherit)
Parameters
Type Name Description
Type attributeType

The type of attribute to search for. Only attributes that are assignable to this type are returned.

Boolean inherit

true to search this member's inheritance chain to find the attributes; otherwise, false.

Returns
Type Description
Object[]

An array that contains all the custom attributes applied to this field.

Overrides
MemberInfo.GetCustomAttributes(Type, Boolean)
| Improve this Doc View Source

GetCustomAttributesData()

Declaration
public override sealed IList<CustomAttributeData> GetCustomAttributesData()
Returns
Type Description
IList<CustomAttributeData>
Overrides
MemberInfo.GetCustomAttributesData()
| Improve this Doc View Source

GetHashCode()

Computes hash code uniquely identifies the reflected field.

Declaration
public override sealed int GetHashCode()
Returns
Type Description
Int32

The hash code of the field.

Overrides
FieldInfo.GetHashCode()
| Improve this Doc View Source

GetOptionalCustomModifiers()

Gets an array of types that identify the optional custom modifiers of the field.

Declaration
public override sealed Type[] GetOptionalCustomModifiers()
Returns
Type Description
Type[]

An array of objects that identify the optional custom modifiers of the current field.

Overrides
FieldInfo.GetOptionalCustomModifiers()
| Improve this Doc View Source

GetRawConstantValue()

Returns a literal value associated with the field by a compiler.

Declaration
public override sealed object GetRawConstantValue()
Returns
Type Description
Object

The literal value associated with the field. If the literal value is a class type with an element value of zero, the return value is null.

Overrides
FieldInfo.GetRawConstantValue()
| Improve this Doc View Source

GetRequiredCustomModifiers()

Gets an array of types that identify the required custom modifiers of the field.

Declaration
public override sealed Type[] GetRequiredCustomModifiers()
Returns
Type Description
Type[]

An array of objects that identify the required custom modifiers of the current field.

Overrides
FieldInfo.GetRequiredCustomModifiers()
| Improve this Doc View Source

GetValue(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

The object whose field value will be returned.

Returns
Type Description
Object

An object containing the value of the field reflected by this instance.

Overrides
FieldInfo.GetValue(Object)
| Improve this Doc View Source

GetValue(Object, out TValue)

Returns the value of a field supported by a given object.

Declaration
public abstract bool GetValue(object obj, out TValue value)
Parameters
Type Name Description
Object obj

The object whose field value will be returned.

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.

| Improve this Doc View Source

GetValueDirect(TypedReference)

Returns the value of a field supported by a given object.

Declaration
[CLSCompliant(false)]
public override sealed object GetValueDirect(TypedReference obj)
Parameters
Type Name Description
TypedReference obj

A managed pointer to a location and a runtime representation of the type that might be stored at that location.

Returns
Type Description
Object

An object containing the value of the field reflected by this instance.

Overrides
FieldInfo.GetValueDirect(TypedReference)
| Improve this Doc View Source

IsDefined(Type, Boolean)

Determines whether one or more attributes of the specified type or of its derived types is applied to this field.

Declaration
public override sealed bool IsDefined(Type attributeType, bool inherit)
Parameters
Type Name Description
Type attributeType

The type of custom attribute to search for. The search includes derived types.

Boolean inherit

true to search this member's inheritance chain to find the attributes; otherwise, false.

Returns
Type Description
Boolean

true if one or more instances of attributeType or any of its derived types is applied to this field; otherwise, false.

Overrides
MemberInfo.IsDefined(Type, Boolean)
| Improve this Doc View Source

SetValue(Object, TValue)

Sets the value of the field supported by the given object.

Declaration
public abstract bool SetValue(object obj, TValue value)
Parameters
Type Name Description
Object obj

The object whose field value will be set.

TValue value

The value to assign to the field.

Returns
Type Description
Boolean

true, if field value is modified successfully; otherwise, false.

| Improve this Doc View Source

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

The object whose field value will be returned.

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
FieldInfo.SetValue(Object, Object, BindingFlags, Binder, CultureInfo)
| Improve this Doc View Source

SetValueDirect(TypedReference, Object)

Sets the value of the field supported by the given object.

Declaration
[CLSCompliant(false)]
public override sealed void SetValueDirect(TypedReference obj, object value)
Parameters
Type Name Description
TypedReference obj

A managed pointer to a location and a runtime representation of the type that might be stored at that location.

Object value

The value to assign to the field.

Overrides
FieldInfo.SetValueDirect(TypedReference, Object)
| Improve this Doc View Source

ToString()

Returns textual representation of this field.

Declaration
public override sealed string ToString()
Returns
Type Description
String

The textual representation of this field.

Overrides
Object.ToString()

Explicit Interface Implementations

| Improve this Doc View Source

IMember<FieldInfo>.RuntimeMember

Declaration
FieldInfo IMember<FieldInfo>.RuntimeMember { get; }
Returns
Type Description
FieldInfo

Implements

IField
IMember<TMember>
System.Reflection.ICustomAttributeProvider
System.IEquatable<T>

Extension Methods

AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, CancellationToken)
ObjectExtensions.GetUserData<T>(T)
ObjectExtensions.IsOneOf<T>(T, IEnumerable<T>)
ObjectExtensions.IsOneOf<T>(T, T[])
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>)
ObjectExtensions.As<T>(T)
CustomAttribute.IsDefined<TAttribute>(ICustomAttributeProvider, Boolean)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
Reflector.Unreflect<TValue>(FieldInfo)
Reflector.Unreflect<T, TValue>(FieldInfo)
Reflector.Unreflect(FieldInfo, BindingFlags)
Reflector.Unreflect(FieldInfo, Boolean, BindingFlags)
ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX