using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace System
{
///
/// is a handle to the internal metadata representation of a method.
/// 2
// Token: 0x020006A4 RID: 1700
[ComVisible(true)]
[MonoTODO("Serialization needs tests")]
[Serializable]
public struct RuntimeMethodHandle : ISerializable
{
// Token: 0x0600407A RID: 16506 RVA: 0x000DBC5C File Offset: 0x000D9E5C
internal RuntimeMethodHandle(IntPtr v)
{
this.value = v;
}
// Token: 0x0600407B RID: 16507 RVA: 0x000DBC68 File Offset: 0x000D9E68
private RuntimeMethodHandle(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
MonoMethod monoMethod = (MonoMethod)info.GetValue("MethodObj", typeof(MonoMethod));
this.value = monoMethod.MethodHandle.Value;
if (this.value == IntPtr.Zero)
{
throw new SerializationException(Locale.GetText("Insufficient state."));
}
}
/// Gets the value of this instance.
/// A that is the internal metadata representation of a method.
/// 2
// Token: 0x17000BE7 RID: 3047
// (get) Token: 0x0600407C RID: 16508 RVA: 0x000DBCDC File Offset: 0x000D9EDC
public IntPtr Value
{
get
{
return this.value;
}
}
/// Populates a with the data necessary to deserialize the field represented by this instance.
/// The object to populate with serialization information.
/// (Reserved) The place to store and retrieve serialized data.
///
/// is null.
///
/// is invalid.
/// 2
// Token: 0x0600407D RID: 16509 RVA: 0x000DBCE4 File Offset: 0x000D9EE4
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
if (this.value == IntPtr.Zero)
{
throw new SerializationException("Object fields may not be properly initialized");
}
info.AddValue("MethodObj", (MonoMethod)MethodBase.GetMethodFromHandle(this), typeof(MonoMethod));
}
// Token: 0x0600407E RID: 16510
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern IntPtr GetFunctionPointer(IntPtr m);
/// Obtains a pointer to the method represented by this instance.
/// A pointer to the method represented by this instance.
/// The caller does not have the necessary permission to perform this operation.
/// 2
// Token: 0x0600407F RID: 16511 RVA: 0x000DBD48 File Offset: 0x000D9F48
public IntPtr GetFunctionPointer()
{
return RuntimeMethodHandle.GetFunctionPointer(this.value);
}
/// Indicates whether this instance is equal to a specified object.
/// true if is a and equal to the value of this instance; otherwise, false.
/// A to compare to this instance.
/// 2
// Token: 0x06004080 RID: 16512 RVA: 0x000DBD58 File Offset: 0x000D9F58
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public override bool Equals(object obj)
{
return obj != null && base.GetType() == obj.GetType() && this.value == ((RuntimeMethodHandle)obj).Value;
}
/// Indicates whether this instance is equal to a specified .
/// true if is equal to the value of this instance; otherwise, false.
/// A to compare to this instance.
/// 2
// Token: 0x06004081 RID: 16513 RVA: 0x000DBDA4 File Offset: 0x000D9FA4
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public bool Equals(RuntimeMethodHandle handle)
{
return this.value == handle.Value;
}
/// Returns the hash code for this instance.
/// A 32-bit signed integer hash code.
/// 2
// Token: 0x06004082 RID: 16514 RVA: 0x000DBDB8 File Offset: 0x000D9FB8
public override int GetHashCode()
{
return this.value.GetHashCode();
}
/// Indicates whether two instances of are equal.
/// true if the value of is equal to the value of ; otherwise, false.
/// A to compare to .
/// A to compare to .
/// 3
// Token: 0x06004083 RID: 16515 RVA: 0x000DBDC8 File Offset: 0x000D9FC8
public static bool operator ==(RuntimeMethodHandle left, RuntimeMethodHandle right)
{
return left.Equals(right);
}
/// Indicates whether two instances of are not equal.
/// true if the value of is unequal to the value of ; otherwise, false.
/// A to compare to .
/// A to compare to .
/// 3
// Token: 0x06004084 RID: 16516 RVA: 0x000DBDD4 File Offset: 0x000D9FD4
public static bool operator !=(RuntimeMethodHandle left, RuntimeMethodHandle right)
{
return !left.Equals(right);
}
// Token: 0x040019A8 RID: 6568
private IntPtr value;
}
}