// Decompiled with JetBrains decompiler
// Type: HPG_68D.My.MySettings
// Assembly: HPG-68D, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 530C99A8-8EEF-42C8-8A74-66FDE7B322C3
// Assembly location: C:\Program Files (x86)\HONGKAIDE\HPG-68D\HPG-68D.exe

using Microsoft.VisualBasic.CompilerServices;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Configuration;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;


namespace HPG_68D.My
{
  [EditorBrowsable(EditorBrowsableState.Advanced)]
  [CompilerGenerated]
  [GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
  internal sealed class MySettings : ApplicationSettingsBase
  {
    private static MySettings defaultInstance = (MySettings) Synchronized(new MySettings());
    private static bool addedHandler;
    private static object addedHandlerLockObject = RuntimeHelpers.GetObjectValue(new object());

    [DebuggerNonUserCode]
    public MySettings()
    {
    }

    [EditorBrowsable(EditorBrowsableState.Advanced)]
    [DebuggerNonUserCode]
    private static void AutoSaveSettings(object sender, EventArgs e)
    {
      if (!MyProject.Application.SaveMySettingsOnExit)
        return;
      MySettingsProperty.Settings.Save();
    }

    public static MySettings Default
    {
      get
      {
        if (!addedHandler)
        {
          var handlerLockObject = addedHandlerLockObject;
          ObjectFlowControl.CheckForSyncLockOnValueType(handlerLockObject);
          Monitor.Enter(handlerLockObject);
          try
          {
            if (!addedHandler)
            {
              MyProject.Application.Shutdown += (sender, e) =>
              {
                if (!MyProject.Application.SaveMySettingsOnExit)
                  return;
                MySettingsProperty.Settings.Save();
              };
              addedHandler = true;
            }
          }
          finally
          {
            Monitor.Exit(handlerLockObject);
          }
        }
        var defaultInstance = MySettings.defaultInstance;
        return defaultInstance;
      }
    }
  }
}
