예제 #1
0
 public static void AddCommandsToTerminal(string name, TerminalCommand command)
 {
     if (!Commands.ContainsKey(name))
     {
         Commands.Add(name, command);
     }
 }
예제 #2
0
        public Command(object instance, MethodInfo method)
        {
            TerminalCommand attribute = GetAttributeData(method);

            this.Instance    = instance;
            this.Method      = method;
            this.Class       = method.DeclaringType.ToString();
            this.Description = attribute.Description;
            this.Parameters  = method.GetParameters();

            this.Name = attribute.Name ?? method.Name;
        }