示例#1
0
        public void DisplayCmd(CmdTrigger <C> trigger, BaseCommand <C> cmd, bool ignoreRestrictions, bool detail)
        {
            trigger.Reply(string.Format("{0}{1}", cmd.CreateUsage(trigger), detail ? " (" + cmd.GetDescription(trigger) + ")" : ""));

            if (cmd.SubCommands.Count > 0)
            {
                trigger.Reply("All SubCommands:");
                foreach (var subCmd in cmd.SubCommands)
                {
                    if (MayDisplay(trigger, subCmd, ignoreRestrictions))
                    {
                        DisplayCmd(trigger, subCmd, ignoreRestrictions, detail);
                    }
                }
            }
        }
示例#2
0
 public void DisplayCmd(CmdTrigger <C> trigger, BaseCommand <C> cmd, bool ignoreRestrictions, bool detail)
 {
     trigger.Reply(string.Format("{0}{1}", (object)cmd.CreateUsage(trigger),
                                 detail ? (object)(" (" + cmd.GetDescription(trigger) + ")") : (object)""));
     if (cmd.SubCommands.Count <= 0)
     {
         return;
     }
     trigger.Reply("All SubCommands:");
     foreach (BaseCommand <C> .SubCommand subCommand in cmd.SubCommands)
     {
         if (this.MayDisplay(trigger, (BaseCommand <C>)subCommand, ignoreRestrictions))
         {
             this.DisplayCmd(trigger, (BaseCommand <C>)subCommand, ignoreRestrictions, detail);
         }
     }
 }