示例#1
0
        public IExecutableCommandRegistration RegisterExecutableCommand(
            string primarySelector,
            IEnumerable <string> aliasSelectors,
            string name,
            string helpText,
            Action <ICommandContext> executeAction)
        {
            var command = new GenericExecutableCommand(primarySelector, aliasSelectors, name, helpText, executeAction);

            registeredCommands.Add(command);
            return(CreateNewInstance(command));
        }
示例#2
0
        public IExecutableCommandRegistration SetChildToExecutableCommand(
            string primarySelector,
            IEnumerable <string> aliasSelectors,
            string name,
            string helpText,
            Action <ICommandContext> executeAction)
        {
            var command = new GenericExecutableCommand(primarySelector, aliasSelectors, name, helpText, executeAction);

            command.Parent = targetCommand;
            (targetCommand as IInputCommand).NextCommand = command;
            return(CreateNewInstance(command));
        }