public static int Main(string[] args) { if (Environment.UserInteractive) { using (var bootStrapper = new Bootstrapper()) { bootStrapper.Bootstrap(); bootStrapper.Start(); Console.WriteLine(String.Format("Continuity server is ready [http://{0}:{1}]", bootStrapper._serverAddress, bootStrapper._serverPort)); Console.WriteLine("Press any key to stop server"); while (true) { var readline = Console.ReadLine(); if (!"CLS".Equals(readline, StringComparison.InvariantCultureIgnoreCase)) break; Console.Clear(); } } } else { ServiceBase.Run(new ContinuityService()); } return 0; }
public ContinuityService() { InitializeComponent(); _bootstrapper = new Bootstrapper(); }