Beispiel #1
0
        private string[] ListCommandNames(string prefix, CommandListOptions options)
        {
            IList <CCommand> commands = CRegistery.ListCommands(delegate(CCommand cmd)
            {
                return(!(cmd is CVarCommand) && CRegistery.ShouldListCommand(cmd, prefix, options));
            });

            return(Collection.Map(commands, delegate(CCommand cmd)
            {
                return C(cmd.Name, cmd.ColorCode);
            }));
        }
Beispiel #2
0
        void Execute(string prefix = null)
        {
            IList <CCommand> cmds = CRegistery.ListCommands(prefix);

            foreach (CCommand cmd in cmds)
            {
                CVarCommand cvarCmd = cmd as CVarCommand;
                if (cvarCmd != null)
                {
                    cvarCmd.ParentCommand = this;
                    cvarCmd.SetDefault();
                    cvarCmd.ParentCommand = null;
                }
            }
        }
Beispiel #3
0
        protected override IList <string> AutoCompleteArgs(string commandLine, string token)
        {
            IList <CCommand> commands = CRegistery.ListCommands(delegate(CCommand command)
            {
                return(!(command is CVarCommand) &&
                       !(command is CDelegateCommand) &&
                       !(command is CAliasCommand) &&
                       CRegistery.ShouldListCommand(command, token, CCommand.DefaultListOptions));
            });

            if (commands.Count == 0)
            {
                return(null);
            }

            return(Collection.Map(commands, delegate(CCommand cmd)
            {
                return StringUtils.C(cmd.Name, cmd.ColorCode);
            }));
        }