Пример #1
0
        /// <summary>
        /// Create a new server command.
        /// </summary>
        /// <param name="name">The string to invoke the command.</param>
        /// <param name="description">A short phrase that explains what actions the command performs or what data it returns.</param>
        /// <param name="passwordRequired">true to only allow execution after the priveledged mode password has been entered; false to make
        /// available always.</param>
        /// <param name="hideHelpText">true to hide help text in unpriveledged mode; false to display it (usefule for things like #SET_PASSWORD).</param>
        /// <param name="commandDelegate">The method that executes the command.</param>
        internal ServerCommand( string name, string description, bool passwordRequired, bool hideHelpText,
			ServerCommandDelegate commandDelegate )
        {
            this._name = name;
            this._description = description;
            this._passwordRequired = passwordRequired;
            this._hideHelpText = hideHelpText;

            this._commandDelegate = commandDelegate;
        }
Пример #2
0
        /// <summary>
        /// Add a new server command.
        /// </summary>
        public void AddCommand( string name, string description, bool passwordRequired, bool hideHelpText,
		                              ServerCommandDelegate command )
        {
            // Add a new ServerCommand
            _serverCommands[ name.ToUpper() ] =
                new ServerCommand( name, description, passwordRequired, hideHelpText, command );
        }