/// <summary> /// Create and loads the command name into the command catalog. /// </summary> /// <param name="commandName">Specifies the command name to load.</param> /// <param name="commandHelp">Specifies the command's website for faster reference.</param> public void Load(String commandName, String commandHelp) { TextBuiltin clazz; Type commandType = Type.GetType(commandName); if (commandType == null) { return; } clazz = Activator.CreateInstance(commandType) as TextBuiltin; if (clazz == null) { return; } int index = clazz.ToString().LastIndexOf("."); string cmdName = clazz.ToString().Substring(index + 1).ToLower(); clazz.setCommandName(cmdName); clazz.setCommandHelp(commandHelp); CommandRef cr = new CommandRef(clazz); if (cr != null) { commands.Add(cr.getName(), cr); } }
/// <summary> /// Create and loads the command name into the command catalog. /// </summary> /// <param name="commandName">Specifies the command name to load.</param> /// <param name="commandHelp">Specifies the command's website for faster reference.</param> public void Load(String commandName, String commandHelp) { TextBuiltin clazz; Type commandType = Type.GetType(commandName); if (commandType == null) return; clazz = Activator.CreateInstance(commandType) as TextBuiltin; if (clazz == null) return; int index = clazz.ToString().LastIndexOf("."); string cmdName = clazz.ToString().Substring(index + 1).ToLower(); clazz.setCommandName(cmdName); clazz.setCommandHelp(commandHelp); CommandRef cr = new CommandRef(clazz); if (cr != null) commands.Add(cr.getName(), cr); }