getName() public method

Returns the friendly command name. The command as invoked from the command line.
public getName ( ) : String
return String
Ejemplo n.º 1
0
        /// <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);
            }
        }
Ejemplo n.º 2
0
        /// <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);
        }