public ConsoleCommand(string name, string description, string usage, ConsoleCommandCallback callback) : this()
 {
     Name        = name;
     Description = (string.IsNullOrEmpty(description.Trim()) ? "No description provided" : description);
     Usage       = (string.IsNullOrEmpty(usage.Trim()) ? "No usage information provided" : usage);
     Callback    = callback;
 }
Beispiel #2
0
 public ConsoleCommand(string name, string description, string usage, ConsoleCommandCallback callback) : this()
 {
     this.name = name;
     this.description = (string.IsNullOrEmpty(description.Trim()) ? "No description provided" : description);
     this.usage = (string.IsNullOrEmpty(usage.Trim()) ? "No usage information provided" : usage);
     this.callback = callback;
 }
 public void RegisterCommand(string command, ConsoleCommandCallback callback)
 {
     repository[command] = new ConsoleCommandCallback(callback);
     if (!repoList.ContainsKey (command)) {
         repoList.Add (command, command);
     }
 }
Beispiel #4
0
 static void Postfix(string command, string description, string usage, ConsoleCommandCallback callback, Dictionary <string, ConsoleCommand> ___Database)
 {
     if (!___Database.ContainsKey(command))
     {
         ___Database.Add(command, new ConsoleCommand(command, description, usage, callback));
     }
 }
 public void RegisterCommand(string command, ConsoleCommandCallback callback)
 {
     repository[command] = new ConsoleCommandCallback(callback);
     if (!repoList.ContainsKey(command))
     {
         repoList.Add(command, command);
     }
 }
    public static void RegisterCommand(string command, ConsoleCommandCallback invoke, string helpText = "")
    {
        CheckForInstance();

        var newCommand = new ConsoleCommand(command, invoke, helpText);

        Instance.RegisterCommand(newCommand);
    }
 public void RegisterCommand(string command, ConsoleCommandCallback callback)
 {
     if (HasCommand(command))
     {
         ConsoleLog.Instance.Log(string.Format("Command already exists: {0}, new definition ignored", command));
         return;
     }
     repository[command] = new ConsoleCommandCallback(callback);
 }
Beispiel #8
0
 public void RegisterCommand(string command, ConsoleCommandCallback callback)
 {
     if (HasCommand(command))
     {
         ConsoleLog.Instance.Log(string.Format("Command already exists: {0}, new definition ignored", command));
         return;
     }
     repository[command] = new ConsoleCommandCallback(callback);
 }
Beispiel #9
0
        public void RegisterCommand(string command, string description = "", ConsoleCommandCallback callback = null)
        {
            if (Commands == null)
            {
                return;
            }

            if (Commands.ContainsKey(command))
            {
                WriteLine($"Command {command} is already registered.");
                return;
            }

            Commands[command]     = callback;
            Descriptions[command] = description;
        }
 public static void RegisterCommand(string command, string description, string usage, ConsoleCommandCallback callback)
 {
     database[command] = new ConsoleCommand(command, description, usage, callback);
 }
Beispiel #11
0
 public static void RegisterCommand(string command, ConsoleCommandCallback callback, string description = "", string usage = "")
 {
     RegisterCommand(command, description, usage, callback);
 }
 // Token: 0x060026E3 RID: 9955 RVA: 0x000BF797 File Offset: 0x000BDB97
 public void RegisterCommand(string command, ConsoleCommandCallback callback, string manual = "")
 {
     this.repository[command]    = new ConsoleCommandCallback(callback.Invoke);
     this.commandManual[command] = manual;
 }
 public static void RegisterCommand(string command, ConsoleCommandCallback callback, string description = "", string usage = "")
 {
     RegisterCommand(command, description, usage, callback);
 }
 public static void RegisterCommand(string command, ConsoleCommandCallback callback)
 {
     RegisterCommand(command, "", "", callback);
 }
 public void RegisterCommand(string command, ConsoleCommandCallback callback)
 {
     repository[command] = new ConsoleCommandCallback(callback);
 }
 public ConsoleCommand(ConsoleCommandCallback callback, string description, IPluginInfo owner)
 {
     Callback    = callback;
     Description = description;
     Owner       = owner;
 }
 public static void RegisterConsoleCommand(string command, ConsoleCommandCallback callback, string description, IPluginInfo owner)
 {
     registeredConsoleCommands.Add(command, new ConsoleCommand(callback, description, owner));
 }
Beispiel #18
0
 public static void RegisterCommand(string command, string description, string usage, ConsoleCommandCallback callback)
 {
     database[command] = new ConsoleCommand(command, description, usage, callback);
 }
 public ConsoleCommand(string command, ConsoleCommandCallback invoke, string helpText)
 {
     Command  = command;
     Invoke   = invoke;
     HelpText = helpText;
 }
 public void RegisterCommand(string command, ConsoleCommandCallback callback) {
   repository[command] = new ConsoleCommandCallback(callback);
 }