Esempio n. 1
0
        public CommandScriptStepAudit Execute(CommandScriptStep task)
        {
            var hostControl = task.CommandScript.Variables.Get<HostControl>();

            var serviceHandle = task.Arguments.Get<ServiceHandle>();
            if (serviceHandle == null)
                throw new ServiceControlException("The service handle was null and could not be started.");

            bool started = serviceHandle.Start(hostControl);

            return new CommandScriptStepAudit(this, new CommandScriptStepResult
                {
                    serviceHandle,
                    { "started", started}
                });
        }
        public CommandScriptStepAudit Execute(CommandScriptStep task)
        {
            bool unloaded = false;
            var serviceHandle = task.Arguments.Get<ServiceHandle>();

            if (serviceHandle != null)
            {
                serviceHandle.Dispose();

                unloaded = true;

                task.Arguments.Set<ServiceHandle>(null);
            }

            return new CommandScriptStepAudit(this, new CommandScriptStepResult {{"unloaded", unloaded}});
        }
Esempio n. 3
0
        public CommandScriptStepAudit Execute(CommandScriptStep task)
        {
            var hostControl = task.CommandScript.Variables.Get<HostControl>();

            bool stopped = false;

            var serviceHandle = task.Arguments.Get<ServiceHandle>();
            if(serviceHandle != null)
            {
                stopped = serviceHandle.Stop(hostControl);
            }
            return new CommandScriptStepAudit(this, new CommandScriptStepResult
                {
                    serviceHandle,
                    {"stopped", stopped}
                });
        }
        public CommandScriptStepAudit Execute(CommandScriptStep task)
        {
            var hostControl = task.CommandScript.Variables.Get <HostControl>();

            bool stopped = false;

            var serviceHandle = task.Arguments.Get <ServiceHandle>();

            if (serviceHandle != null)
            {
                stopped = serviceHandle.Stop(hostControl);
            }
            return(new CommandScriptStepAudit(this, new CommandScriptStepResult
            {
                serviceHandle,
                { "stopped", stopped }
            }));
        }
Esempio n. 5
0
        public CommandScriptStepAudit Execute(CommandScriptStep task)
        {
            var hostControl = task.CommandScript.Variables.Get <HostControl>();

            var serviceHandle = task.Arguments.Get <ServiceHandle>();

            if (serviceHandle == null)
            {
                throw new ServiceControlException("The service handle was null and could not be started.");
            }

            bool started = serviceHandle.Start(hostControl);

            return(new CommandScriptStepAudit(this, new CommandScriptStepResult
            {
                serviceHandle,
                { "started", started }
            }));
        }
Esempio n. 6
0
        public CommandScriptStepAudit Execute(CommandScriptStep task)
        {
            _log.Debug("CreateServiceCommand Executing...");

            var result = new CommandScriptStepResult();

            var settings    = task.CommandScript.Variables.Get <HostSettings>();
            var hostControl = task.CommandScript.Variables.Get <HostControl>();

            var serviceBuilderFactory = task.Arguments.Get <ServiceBuilderFactory>();

            ServiceHandle serviceHandle = new ServiceHandleProxy(settings, hostControl, serviceBuilderFactory);

            task.Arguments.Set(serviceHandle);

            result.Add(serviceHandle);

            return(new CommandScriptStepAudit(this, result));
        }
Esempio n. 7
0
        public CommandScriptStepAudit Execute(CommandScriptStep task)
        {
            _log.Debug("CreateServiceCommand Executing...");

            var result = new CommandScriptStepResult();

            var settings = task.CommandScript.Variables.Get<HostSettings>();
            var hostControl = task.CommandScript.Variables.Get<HostControl>();

            var serviceBuilderFactory = task.Arguments.Get<ServiceBuilderFactory>();

            ServiceHandle serviceHandle = new ServiceHandleProxy(settings, hostControl, serviceBuilderFactory);

            task.Arguments.Set(serviceHandle);

            result.Add(serviceHandle);

            return new CommandScriptStepAudit(this, result);
        }