protected override Result RunCore(Argument[] args)
        {
            var cafeServerWindowsService = new CafeServerWindowsService();
            var serviceHost = new Win32ServiceHost(cafeServerWindowsService);

            serviceHost.Run();
            return(Result.Successful());
        }
示例#2
0
        protected override Result RunCore(Argument[] args)
        {
            var cafeServerWindowsService = new CafeServerWindowsService();

            cafeServerWindowsService.Start(new string[0], () => { });
            Presenter.ShowMessage("Running interactively, press ctrl+c to stop", Logger);
            // don't use Console.ReadLine because it interferes with
            // console redirection done to keep an eye on processes
            // that this kicks off
            new AutoResetEvent(false).WaitOne();
            cafeServerWindowsService.Stop();
            return(Result.Successful());
        }