static void Main()
 {
     using (var service = new ProgramService())
     {
         if (Environment.UserInteractive)
         {
             service.OnStart(null);
             Console.WriteLine("Bus started. Press any key to exit");
             Console.ReadKey();
             service.OnStop();
             return;
         }
         Run(service);
     }
 }
示例#2
0
 static void Main()
 {
     using (var service = new ProgramService())
     {
         if (ServiceHelper.IsService())
         {
             Run(service);
             return;
         }
         service.OnStart(null);
         Console.WriteLine("Bus started. Press any key to exit");
         Console.ReadKey();
         service.OnStop();
     }
 }
 static void Main()
 {
     using (var service = new ProgramService())
     {
         if (Environment.UserInteractive)
         {
             service.OnStart(null);
             Console.WriteLine("Bus created and configured");
             Console.WriteLine("Press any key to exit");
             Console.ReadKey();
             service.OnStop();
             return;
         }
         Run(service);
     }
 }