// Decompiled with JetBrains decompiler
// Type: SE0085.Q2CdB.MDSS_dbmdsEntities
// Assembly: SE0085Q2CdB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: A5680110-30A2-457F-A920-E4C024719231
// Assembly location: C:\Users\Abishek\Downloads\SchneiderCode_Breaker_09292016\Breaker Schedule-20160930T014118Z\Breaker Schedule\Solution for gathering Breaker Data\DMS\bin\Debug\SE0085Q2CdB.dll

using System;
using System.Collections.Generic;
using System.Data.EntityClient;
using System.Data.Objects;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;

namespace SE0085.Q2CdB
{
  public class MDSS_dbmdsEntities : ObjectContext
  {
    private static List<WeakReference> __ENCList = new List<WeakReference>();
    private ObjectSet<SE0085.Q2CdB.mdsq2ccd> _mdsq2ccd;

    public ObjectSet<SE0085.Q2CdB.mdsq2ccd> mdsq2ccd
    {
      get
      {
        if (this._mdsq2ccd == null)
          this._mdsq2ccd = (ObjectSet<SE0085.Q2CdB.mdsq2ccd>) this.CreateObjectSet<SE0085.Q2CdB.mdsq2ccd>("mdsq2ccd");
        return this._mdsq2ccd;
      }
    }

    [DebuggerNonUserCode]
    static MDSS_dbmdsEntities()
    {
    }

    public MDSS_dbmdsEntities()
      : base("name=MDSS_dbmdsEntities", "MDSS_dbmdsEntities")
    {
      MDSS_dbmdsEntities.__ENCAddToList((object) this);
      this.get_ContextOptions().set_LazyLoadingEnabled(true);
    }

    public MDSS_dbmdsEntities(string connectionString)
      : base(connectionString, "MDSS_dbmdsEntities")
    {
      MDSS_dbmdsEntities.__ENCAddToList((object) this);
      this.get_ContextOptions().set_LazyLoadingEnabled(true);
    }

    public MDSS_dbmdsEntities(EntityConnection connection)
      : base(connection, "MDSS_dbmdsEntities")
    {
      MDSS_dbmdsEntities.__ENCAddToList((object) this);
      this.get_ContextOptions().set_LazyLoadingEnabled(true);
    }

    [DebuggerNonUserCode]
    private static void __ENCAddToList(object value)
    {
      List<WeakReference> encList = MDSS_dbmdsEntities.__ENCList;
      bool flag = false;
      try
      {
        Monitor.Enter((object) encList, ref flag);
        if (MDSS_dbmdsEntities.__ENCList.Count == MDSS_dbmdsEntities.__ENCList.Capacity)
        {
          int index1 = 0;
          int num1 = 0;
          int num2 = checked (MDSS_dbmdsEntities.__ENCList.Count - 1);
          int index2 = num1;
          while (index2 <= num2)
          {
            if (MDSS_dbmdsEntities.__ENCList[index2].IsAlive)
            {
              if (index2 != index1)
                MDSS_dbmdsEntities.__ENCList[index1] = MDSS_dbmdsEntities.__ENCList[index2];
              checked { ++index1; }
            }
            checked { ++index2; }
          }
          MDSS_dbmdsEntities.__ENCList.RemoveRange(index1, checked (MDSS_dbmdsEntities.__ENCList.Count - index1));
          MDSS_dbmdsEntities.__ENCList.Capacity = MDSS_dbmdsEntities.__ENCList.Count;
        }
        MDSS_dbmdsEntities.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
      }
      finally
      {
        if (flag)
          Monitor.Exit((object) encList);
      }
    }

    public void AddTomdsq2ccd(SE0085.Q2CdB.mdsq2ccd mdsq2ccd)
    {
      this.AddObject("mdsq2ccd", (object) mdsq2ccd);
    }
  }
}
