예제 #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");
        }
예제 #2
0
 public static ScannerGunHelper GetInstance(IScannerGunInterface gunInterface)
 {
     mInterface = gunInterface;
     if (mHelper == null)
     {
         hook    = new ScannerGunHook();
         mHelper = new ScannerGunHelper();
     }
     return(mHelper);
 }
예제 #3
0
 public static void Close()
 {
     if (hook != null)
     {
         hook.Stop();
     }
     if (mInterface != null)
     {
         mInterface = null;
     }
     if (mHelper != null)
     {
         mHelper = null;
     }
 }
예제 #4
0
 private void StartKeyBoardHook()
 {
     ScannerGunHelper.GetInstance(this).Start();
 }