Example #1
0
        void ApplicationCloseDoEvent()
        {
            if (ComWithSqlServer != null)
            {
                FileService.SaveUserConfig(ComWithSqlServer);
            }
            FileService.SaveApplicationConfig(ToolStripMenuItemAuto.Checked);
            notifyIcon1.Visible = false;
            #region 释放所有资源
            if (ComWithSqlServer != null)
            {
                ComWithSqlServer?.CloseDatabase();
                ComWithSqlServer = null;
            }
            if (UpLoadThread != null)
            {
                UpLoadThread.Abort();
                UpLoadThread = null;
            }
            if (InitThread != null)
            {
                InitThread.Abort();
                InitThread = null;
            }

            #endregion
        }
Example #2
0
        public void Form_Main_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (ComWithSqlServer != null)
            {
                ComWithSqlServer?.CloseDatabase();
                ComWithSqlServer = null;
            }

            if (UpLoadThread != null)
            {
                UpLoadThread.Abort();
                UpLoadThread = null;
            }

            if (master != null)
            {
                master.Dispose();
                master = null;
            }

            //FileSave.ClosingSaveAppInfo(demarcate, flowMeterStandard, flowMeterWork);
        }