static void Main(string[] args) { using (LogProvider.OpenNestedContext("AlikaPosConsole_MAIN")) { log.Info("Starting AlikaPosConsole Application"); Console.WriteLine("Press enter key to exit"); Console.WriteLine(); using (IScanner scanner = CreateScanner(args.Length == 0)) { try { log.InfoFormat("Activate hardware event subscriber [{0}]", scanner); scanner.Activate(); Console.WriteLine(scanner); Console.WriteLine("Scan documents now"); Console.ReadLine(); } catch (Exception e) { log.FatalFormat("Failure to activate subscriber [{0}] exception [{1}]", scanner, e); } } log.Info("Terminating AlikaPosConsole Application"); } }