コード例 #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));
        }