protected override void OnStart(string[] args) { // Initialize log manager. LogManager.SetImplementation(Log4NetManager.Instance); List <Listener> listenerList = ListenHelper.GetListeners(); foreach (var listenerItem in listenerList) { PrintService.Start(listenerItem.ListenPort, listenerItem.AETitle); Console.WriteLine("Stopping print service"); } }
private static void Main(string[] args) { // Initialize log manager. LogManager.SetImplementation(Log4NetManager.Instance); List <Listener> listenerList = ListenHelper.GetListeners(); foreach (var listenerItem in listenerList) { PrintService.Start(listenerItem.ListenPort, listenerItem.AETitle); Console.WriteLine("Press any key to stop the service"); Console.Read(); Console.WriteLine("Stopping print service"); PrintService.Stop(); } }