Exemple #1
0
        public IInputCommandRegistration RegisterInputCommand(
            string primarySelector,
            IEnumerable <string> aliasSelectors,
            string name,
            string helpText,
            Func <ICommandContext, string> getPromptTextFunc,
            Action <ICommandContext, string> applyInputAction,
            Func <ICommandContext, string> getDefaultFunc)
        {
            var command = new GenericInputCommand(
                primarySelector,
                aliasSelectors,
                name,
                helpText,
                getPromptTextFunc,
                applyInputAction,
                getDefaultFunc);

            registeredCommands.Add(command);
            return(CreateNewInstance(command));
        }
Exemple #2
0
        public IInputCommandRegistration SetChildToInputCommand(
            string primarySelector,
            IEnumerable <string> aliasSelectors,
            string name,
            string helpText,
            Func <ICommandContext, string> getPromptTextFunc,
            Action <ICommandContext, string> applyInputAction,
            Func <ICommandContext, string> getDefaultFunc)
        {
            var command = new GenericInputCommand(
                primarySelector,
                aliasSelectors,
                name,
                helpText,
                getPromptTextFunc,
                applyInputAction,
                getDefaultFunc);

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