コード例 #1
0
 private void ActionSimulate(ServicesCollection services)
 {
     Console.WriteLine("Simulating service...");
     services.Simulate(Task.Factory.StartNew(() =>
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         Application.Run(new StatusDisplay(LocalStatusLogger.GetInstance()));
     }));
 }
コード例 #2
0
        public ServicesManager(ServicesCollection services)
        {
            this.services = services;

            RegisterAction("install", "Install the service", ActionInstall);
            RegisterAction("uninstall", "Uninstall the service", ActionUninstall);
            RegisterAction("reinstall", "Reinstall the service", ActionReinstall);
            RegisterAction("start", "Start the service", ActionStart);
            RegisterAction("stop", "Stop the service", ActionStop);
            RegisterAction("restart", "Restart the service", ActionRestart);
            RegisterAction("simulate", null, ActionSimulate);
        }
コード例 #3
0
 private void ActionRestart(ServicesCollection services)
 {
     Console.WriteLine("Restarting service...");
     services.InvokeRestart();
 }
コード例 #4
0
 private void ActionStop(ServicesCollection services)
 {
     Console.WriteLine("Stoping service...");
     services.InvokeStop();
 }
コード例 #5
0
 private void ActionReinstall(ServicesCollection services)
 {
     Console.WriteLine("Reinstalling service...");
     services.InvokeStop();
     services.Reinstall();
 }
コード例 #6
0
 private void ActionInstall(ServicesCollection services)
 {
     Console.WriteLine("Installing service...");
     services.Install();
 }