public static WindowsServiceCommand Start(IWindowsServiceCommand command) { var cmd = new WindowsServiceCommand(command.ServiceName, command.TimeOut); cmd.Action = cmd.Start; return(cmd); }
public WindowsServiceCommand Get(IWindowsServiceCommand command) { if (command is IWindowsServiceStartCommand) { return(WindowsServiceCommand.Start(command)); } if (command is IWindowsServiceStopCommand) { return(WindowsServiceCommand.Stop(command)); } throw new ArgumentException(); }