13 [__DynamicallyInvokable]
16 private IRuntimeFieldInfo m_ptr;
29 return m_ptr.Value.Value;
35 IRuntimeFieldInfo ptr = m_ptr;
40 return new RuntimeFieldHandle(ptr);
43 internal RuntimeFieldHandle(IRuntimeFieldInfo fieldInfo)
48 internal IRuntimeFieldInfo GetRuntimeFieldInfo()
53 internal bool IsNullHandle()
60 [SecuritySafeCritical]
61 [__DynamicallyInvokable]
71 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
72 [SecuritySafeCritical]
73 [__DynamicallyInvokable]
74 public override bool Equals(
object obj)
87 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
88 [SecuritySafeCritical]
89 [__DynamicallyInvokable]
100 [__DynamicallyInvokable]
103 return left.
Equals(right);
111 [__DynamicallyInvokable]
114 return !left.
Equals(right);
119 internal static extern string GetName(RtFieldInfo field);
123 private unsafe
static extern void* _GetUtf8Name(RuntimeFieldHandleInternal field);
125 [SecuritySafeCritical]
126 internal unsafe
static Utf8String GetUtf8Name(RuntimeFieldHandleInternal field)
128 return new Utf8String(_GetUtf8Name(field));
133 internal static extern bool MatchesNameHash(RuntimeFieldHandleInternal handle, uint hash);
137 internal static extern FieldAttributes GetAttributes(RuntimeFieldHandleInternal field);
141 internal static extern RuntimeType GetApproxDeclaringType(RuntimeFieldHandleInternal field);
144 internal static RuntimeType GetApproxDeclaringType(IRuntimeFieldInfo field)
146 RuntimeType approxDeclaringType = GetApproxDeclaringType(field.Value);
148 return approxDeclaringType;
153 internal static extern int GetToken(RtFieldInfo field);
157 internal static extern object GetValue(RtFieldInfo field,
object instance, RuntimeType fieldType, RuntimeType declaringType, ref
bool domainInitialized);
161 internal unsafe
static extern object GetValueDirect(RtFieldInfo field, RuntimeType fieldType,
void* pTypedRef, RuntimeType contextType);
165 internal static extern void SetValue(RtFieldInfo field,
object obj,
object value, RuntimeType fieldType,
FieldAttributes fieldAttr, RuntimeType declaringType, ref
bool domainInitialized);
169 internal unsafe
static extern void SetValueDirect(RtFieldInfo field, RuntimeType fieldType,
void* pTypedRef,
object value, RuntimeType contextType);
173 internal static extern RuntimeFieldHandleInternal GetStaticFieldForGenericType(RuntimeFieldHandleInternal field, RuntimeType declaringType);
177 internal static extern bool AcquiresContextFromThis(RuntimeFieldHandleInternal field);
181 [SuppressUnmanagedCodeSecurity]
183 private static extern bool IsSecurityCritical(RuntimeFieldHandle fieldHandle);
185 [SecuritySafeCritical]
186 internal bool IsSecurityCritical()
188 return IsSecurityCritical(GetNativeHandle());
193 [SuppressUnmanagedCodeSecurity]
195 private static extern bool IsSecuritySafeCritical(RuntimeFieldHandle fieldHandle);
197 [SecuritySafeCritical]
198 internal bool IsSecuritySafeCritical()
200 return IsSecuritySafeCritical(GetNativeHandle());
205 [SuppressUnmanagedCodeSecurity]
207 private static extern bool IsSecurityTransparent(RuntimeFieldHandle fieldHandle);
209 [SecuritySafeCritical]
210 internal bool IsSecurityTransparent()
212 return IsSecurityTransparent(GetNativeHandle());
217 [SuppressUnmanagedCodeSecurity]
218 internal static extern void CheckAttributeAccess(RuntimeFieldHandle fieldHandle, RuntimeModule decoratedTarget);
225 throw new ArgumentNullException(
"info");
227 FieldInfo fieldInfo = (RuntimeFieldInfo)info.GetValue(
"FieldObj", typeof(RuntimeFieldInfo));
228 if (fieldInfo ==
null)
232 RuntimeFieldHandle fieldHandle = fieldInfo.
FieldHandle;
233 m_ptr = fieldHandle.m_ptr;
257 RuntimeFieldInfo value = (RuntimeFieldInfo)RuntimeType.GetFieldInfo(GetRuntimeFieldInfo());
258 info.AddValue(
"FieldObj", value, typeof(RuntimeFieldInfo));
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
override bool Equals(object obj)
Indicates whether the current instance is equal to the specified object.
Discovers the attributes of a field and provides access to field metadata.
Represents a field using an internal metadata token.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Cer
Specifies a method's behavior when called within a constrained execution region.
Provides information about, and means to manipulate, the current environment and platform....
abstract RuntimeFieldHandle FieldHandle
Gets a RuntimeFieldHandle, which is a handle to the internal metadata representation of a field.
UnmanagedType
Identifies how to marshal parameters or fields to unmanaged code.
FieldAttributes
Specifies flags that describe the attributes of a field.
A platform-specific type that is used to represent a pointer or a handle.
void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a T:System.Runtime.Serialization.SerializationInfo with the data necessary to deserialize t...
The exception thrown when an error occurs during serialization or deserialization.
IntPtr Value
Gets a handle to the field represented by the current instance.
MethodImplOptions
Defines the details of how a method is implemented.
CharSet
Dictates which character set marshaled strings should use.
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
static bool operator !=(RuntimeFieldHandle left, RuntimeFieldHandle right)
Indicates whether two T:System.RuntimeFieldHandle structures are not equal.
Allows an object to control its own serialization and deserialization.
bool Equals(RuntimeFieldHandle handle)
Indicates whether the current instance is equal to the specified T:System.RuntimeFieldHandle.
static readonly IntPtr Zero
A read-only field that represents a pointer or handle that has been initialized to zero.
Specifies that the class can be serialized.
Consistency
Specifies a reliability contract.
override int GetHashCode()
Returns the hash code for this instance.
Provides the base class for value types.
static bool operator==(RuntimeFieldHandle left, RuntimeFieldHandle right)
Indicates whether two T:System.RuntimeFieldHandle structures are equal.