예제 #1
0
파일: KlonsData.cs 프로젝트: Camel-RD/Klons
        private bool IsDisposed = false; // To detect redundant calls

        public void Dispose()
        {
            if (KlonsTableAdapterManager?.TUSERSTableAdapter?.Connection != null)
            {
                KlonsTableAdapterManager.TUSERSTableAdapter.Connection.StateChange -= Connection_StateChange;
            }
            _KlonsData = null;
            IsDisposed = true;
        }
예제 #2
0
파일: KlonsData.cs 프로젝트: Camel-RD/Klons
 public static void ResetInstance()
 {
     if (_KlonsData == null)
     {
         _KlonsData.Dispose();
         _KlonsData = null;
     }
     _KlonsData       = new KlonsData();
     _KlonsDataModule = _KlonsData;
 }
예제 #3
0
파일: KlonsData.cs 프로젝트: Camel-RD/Klons
        private KlonsData()
        {
            _KlonsData   = this;
            CurrentDBTag = null;

            LoadSettings();
            LoadMasterList();

            ColorThemeHelper.MyToolStripRenderer.SetColorTheme(Settings.ColorTheme);

            if (Settings.MasterEntry.Name != "")
            {
                var me = MasterList.GetMasterEntryByName(Settings.MasterEntry.Name);
                if (me != null)
                {
                    Settings.MasterEntry.CopyFrom(me);
                }
            }

            _Params = new KlonsParams();

            ReportHelper = new ReportHelperP();

            _klonsDataSetHelper = new DataSetHelper(
                typeof(KlonsPDataSet),
                typeof(KlonsAdapters.TableAdapterManager),
                typeof(KlonsAdapters.QueriesTableAdapter),
                "ConnectionString1",
                KlonsP.Properties.Settings.Default);

            _dataSetHelpers["KlonsData"] = _klonsDataSetHelper;

            _klonsRepDataSetHelper = new DataSetHelper(
                typeof(KlonsPRepDataSet),
                typeof(KlonsRepAdapters.TableAdapterManager),
                null,
                "ConnectionString1",
                KlonsP.Properties.Settings.Default);

            _dataSetHelpers["KlonsRep"] = _klonsRepDataSetHelper;
        }