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