public virtual BaseCommand <C> GetCommand(CmdTrigger <C> trigger) { int position = trigger.Text.Position; BaseCommand <C> baseCommand; string alias; if (trigger.selectedCmd != null && (BaseCommand <C> .SubCommand)(baseCommand = (BaseCommand <C>)trigger.selectedCmd.SelectSubCommand(trigger.Text)) != null) { alias = trigger.selectedCmd.Aliases[0]; } else { trigger.Text.Position = position; alias = trigger.Text.NextWord(); baseCommand = (BaseCommand <C>) this.Get(alias); } trigger.Alias = alias; if (baseCommand != null) { return(baseCommand); } CommandMgr <C> .UnknownCommandHandler unknownCommand = this.UnknownCommand; if (unknownCommand != null) { unknownCommand(trigger); } return((BaseCommand <C>)null); }
public ExecFileCommand(CommandMgr <C> mgr) { this.m_Mgr = mgr; }
public HelpCommand(CommandMgr <C> mgr) { this.m_Mgr = mgr; }
public void ExecFile(string filename, C args, Func <CmdTrigger <C>, int, bool> cmdValidator) { CommandMgr <C> .ConsoleCmdTrigger consoleCmdTrigger = new CommandMgr <C> .ConsoleCmdTrigger(args); this.ExecFile(filename, (CmdTrigger <C>)consoleCmdTrigger, cmdValidator); }
public void ExecFile(string filename, C args) { CommandMgr <C> .ConsoleCmdTrigger consoleCmdTrigger = new CommandMgr <C> .ConsoleCmdTrigger(args); this.ExecFile(filename, (CmdTrigger <C>)consoleCmdTrigger, (Func <CmdTrigger <C>, int, bool>)null); }