Beispiel #1
0
        public static WindowsServiceCommand Start(IWindowsServiceCommand command)
        {
            var cmd = new WindowsServiceCommand(command.ServiceName, command.TimeOut);

            cmd.Action = cmd.Start;
            return(cmd);
        }
Beispiel #2
0
        public WindowsServiceCommand Get(IWindowsServiceCommand command)
        {
            if (command is IWindowsServiceStartCommand)
            {
                return(WindowsServiceCommand.Start(command));
            }

            if (command is IWindowsServiceStopCommand)
            {
                return(WindowsServiceCommand.Stop(command));
            }

            throw new ArgumentException();
        }