Example #1
0
        /// <summary>
        /// save the config file's config Item to database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Application_Exit(object sender, ExitEventArgs e)
        {
            ScannerGunHelper.Close();

            //DateTime start = DateTime.Now;
            //    try
            //    {
            //        insertOrUpdateConnectionStrings();
            //}
            //    catch (Exception exception)
            //    {
            //        ConsoleHelper.writeLine("save app ConnectionStrings to dabase error: " + exception.Message);
            //    }
            //try
            //{
            InsertOrUpdateAppSettings();
            SaveTempData();
            CommonFunction.UpdateUsedBaseData();
            //}
            //catch (Exception exception)
            //{
            //    ConsoleHelper.writeLine("save AppSettings to dabase error: " + exception.Message);
            //}
            //double time = DateTimeHelper.DateDifflMilliseconds(start, DateTime.Now);

            //ConsoleHelper.writeLine("use time :" + time + " ms");
        }
Example #2
0
 public static ScannerGunHelper GetInstance(IScannerGunInterface gunInterface)
 {
     mInterface = gunInterface;
     if (mHelper == null)
     {
         hook    = new ScannerGunHook();
         mHelper = new ScannerGunHelper();
     }
     return(mHelper);
 }
Example #3
0
 public static void Close()
 {
     if (hook != null)
     {
         hook.Stop();
     }
     if (mInterface != null)
     {
         mInterface = null;
     }
     if (mHelper != null)
     {
         mHelper = null;
     }
 }
Example #4
0
 private void StartKeyBoardHook()
 {
     ScannerGunHelper.GetInstance(this).Start();
 }