예제 #1
0
파일: Program.cs 프로젝트: sbarnabas/OCTGN
 internal static void StartService()
 {
     Log.Info("Starting in Service mode");
     Service = new Service();
     Service.OnServiceStop += (sender, args) => Stop(false);
     var services = new ServiceBase[] { Service };
     ServiceBase.Run(services);
 }
예제 #2
0
파일: Program.cs 프로젝트: jonbonne/OCTGN
 internal static void StartServiceCommandLine()
 {
     Log.Info("Starting in CommandLine mode");
     using (Service = new Service())
     {
         KeepRunning = true;
         Service.Start();
         Service.OnServiceStop += (sender, args) => Stop(false);
         Console.WriteLine("Press 'q' to quit");
         while (KeepRunning)
         {
             if (!Local && Console.KeyAvailable && Console.ReadKey().Key == ConsoleKey.Q) break;
             Thread.Sleep(100);
         }
         Stop();
     }
 }