Example #1
0
        public IProcessAsyncOperation Execute(ExecutionCommand command, IConsole console, bool allowPrompt, bool forcePrompt)
        {
            if ((PromptForParameters || forcePrompt) && allowPrompt)
            {
                var ctx = new CommandExecutionContext(Project, command);
                CustomExecutionMode customMode = ExecutionModeCommandService.ShowParamtersDialog(ctx, Mode, this);
                if (customMode == null)
                {
                    return(new CancelledProcessAsyncOperation());
                }
                return(customMode.Execute(command, console, false, false));
            }

            foreach (var cc in GetCachedCustomizers())
            {
                cc.Item1.Customize(command, cc.Item2);
            }

            var cmode = Mode.ExecutionHandler as ParameterizedExecutionHandler;

            if (cmode != null)
            {
                CommandExecutionContext ctx = new CommandExecutionContext(Project, command);
                return(cmode.Execute(command, console, ctx, Data));
            }

            return(Mode.ExecutionHandler.Execute(command, console));
        }
Example #2
0
        internal IProcessAsyncOperation InternalExecute(CommandExecutionContext ctx, IExecutionMode mode, ExecutionCommand command, IConsole console)
        {
            CustomExecutionMode cmode = ExecutionModeCommandService.ShowParamtersDialog(ctx, mode, null);

            if (cmode == null)
            {
                return(new CancelledProcessAsyncOperation());
            }

            return(cmode.Execute(command, console, false, false));
        }
Example #3
0
        public IProcessAsyncOperation Execute(ExecutionCommand command, IConsole console, bool allowPrompt, bool forcePrompt)
        {
            if ((PromptForParameters || forcePrompt) && allowPrompt)
            {
                CommandExecutionContext ctx        = new CommandExecutionContext(Project, command);
                CustomExecutionMode     customMode = ExecutionModeCommandService.ShowParamtersDialog(ctx, Mode, this);
                if (customMode == null)
                {
                    return(new CancelledProcessAsyncOperation());
                }
                else
                {
                    return(customMode.Execute(command, console, false, false));
                }
            }
            if (commandData != null)
            {
                foreach (KeyValuePair <string, object> cmdData in commandData)
                {
                    ExecutionCommandCustomizer cc = ExecutionModeCommandService.GetExecutionCommandCustomizer(cmdData.Key);
                    if (cc != null)
                    {
                        cc.Customize(command, cmdData.Value);
                    }
                }
            }
            ParameterizedExecutionHandler cmode = Mode.ExecutionHandler as ParameterizedExecutionHandler;

            if (cmode != null)
            {
                CommandExecutionContext ctx = new CommandExecutionContext(Project, command);
                return(cmode.Execute(command, console, ctx, Data));
            }
            else
            {
                return(Mode.ExecutionHandler.Execute(command, console));
            }
        }