예제 #1
0
        public IContainerCommandRegistration RegisterContainerCommand(
            string primarySelector,
            IEnumerable <string> aliasSelectors,
            string name,
            string helpText,
            Func <ICommandContext, IEnumerable <ICommand>, ICommand> getDefaultCommandFunc)
        {
            var command = new GenericContainerCommand(
                primarySelector,
                aliasSelectors,
                name,
                helpText,
                getDefaultCommandFunc);

            registeredCommands.Add(command);
            return(CreateNewInstance(command));
        }
예제 #2
0
        public IContainerCommandRegistration AddContainerCommand(
            string primarySelector,
            IEnumerable <string> aliasSelectors,
            string name,
            string helpText,
            Func <ICommandContext, IEnumerable <ICommand>, ICommand> getDefaultCommandFunc)
        {
            var command = new GenericContainerCommand(
                primarySelector,
                aliasSelectors,
                name,
                helpText,
                getDefaultCommandFunc);

            command.Parent = targetCommand;
            (targetCommand as IContainerCommandEdit).AddChild(command);
            return(CreateNewInstance(command));
        }