﻿// Decompiled with JetBrains decompiler
// Type: System.Runtime.Serialization.MemberHolder
// Assembly: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 255ABCDF-D9D6-4E3D-BAD4-F74D4CE3D7A8
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll

using System;
using System.Reflection;
using System.Runtime;

namespace System.Runtime.Serialization
{
  [Serializable]
  internal class MemberHolder
  {
    internal MemberInfo[] members;
    internal Type memberType;
    internal StreamingContext context;

    [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
    internal MemberHolder(Type type, StreamingContext ctx)
    {
      this.memberType = type;
      this.context = ctx;
    }

    public override int GetHashCode()
    {
      return this.memberType.GetHashCode();
    }

    public override bool Equals(object obj)
    {
      if (!(obj is MemberHolder))
        return false;
      MemberHolder memberHolder = (MemberHolder) obj;
      return object.ReferenceEquals((object) memberHolder.memberType, (object) this.memberType) && memberHolder.context.State == this.context.State;
    }
  }
}
