Show / Hide Table of Contents

Class FieldBase<V>

Represents reflected field.

Inheritance
Object
FieldBase<V>
Field<V>
Field<T, V>
Implements
IField
IMember<FieldInfo>
ICustomAttributeProvider
IEquatable<FieldInfo>
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public abstract class FieldBase<V> : FieldInfo, IField, IMember<FieldInfo>, ICustomAttributeProvider, IEquatable<FieldInfo>
Type Parameters
Name Description
V

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
| 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>
| Improve this Doc View Source

DeclaringType

Gets the class that declares this field.

Declaration
public override sealed Type DeclaringType { get; }
Property Value
Type Description
DotNext.Reflection.Type
| 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
| Improve this Doc View Source

FieldType

Gets type of this field.

Declaration
public override sealed Type FieldType { get; }
Property Value
Type Description
DotNext.Reflection.Type
| 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
| 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
| 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
| Improve this Doc View Source

MemberType

Always returns .

Declaration
public override sealed MemberTypes MemberType { get; }
Property Value
Type Description
MemberTypes
| 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
| 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
| Improve this Doc View Source

Name

Gets name of the field.

Declaration
public override sealed string Name { get; }
Property Value
Type Description
String
| 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
DotNext.Reflection.Type

Methods

| 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

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.

| 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
DotNext.Reflection.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.

| 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.

| Improve this Doc View Source

GetCustomAttributesData()

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

Declaration
public override sealed IList<CustomAttributeData> GetCustomAttributesData()
Returns
Type Description
IList<CustomAttributeData>
| 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.

| 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
DotNext.Reflection.Type[]

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

| 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.

| 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
DotNext.Reflection.Type[]

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

| 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.

| Improve this Doc View Source

GetValue(Object, out V)

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

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

The object whose field value will be returned.

V 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
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.

| 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
DotNext.Reflection.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.

| Improve this Doc View Source

SetValue(Object, V)

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

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

The object whose field value will be set.

V 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.

| Improve this Doc View Source

SetValueDirect(TypedReference, Object)

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

Declaration
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.

| 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.

Explicit Interface Implementations

| Improve this Doc View Source

IMember<FieldInfo>.RuntimeMember

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

Implements

IField
IMember<M>
ICustomAttributeProvider
IEquatable<>

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)
ExpressionBuilder.Const<T>(T)
ObjectExtensions.GetUserData<T>(T)
ObjectExtensions.IsOneOf<T>(T, IEnumerable<T>)
ObjectExtensions.IsOneOf<T>(T, T[])
ObjectExtensions.Decompose<T, R1, R2>(T, Func<T, R1>, Func<T, R2>, out R1, out R2)
ObjectExtensions.Decompose<T, R1, R2>(T, ValueFunc<T, R1>, ValueFunc<T, R2>, out R1, out R2)
ObjectExtensions.Decompose<T, R1, R2>(T, Func<T, R1>, Func<T, R2>)
ObjectExtensions.Decompose<T, R1, R2>(T, ValueFunc<T, R1>, ValueFunc<T, R2>)
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)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX