C# Class DeveloperCommands.Devcom

Contains methods for loading, prompting for, and executing commands using the Devcom engine.
Datei anzeigen Open project: TheBerkin/Devcom

Public Properties

Property Type Description
OnPrint PrintCallback

Public Methods

Method Description
CreateCommand ( MethodInfo method, string name, string description, string category, DeveloperCommands.ContextFilter filter = null ) : DeveloperCommands.Command

Creates a new command using the specified method, metadata, and an optional filter.

Load ( bool loadConfig = true ) : void

Scans all assemblies in the current application domain, and their references, for command/convar definitions.

Log ( object value ) : void

Prints an object's string value to the Devcom output.

SaveConfig ( ) : void

Saves the current configuration of the engine.

SearchCommands ( string query, bool beginsWith = true ) : IEnumerable

Searches for commands containing the specified substring and returns a collection of matches.

SearchConvars ( string query, bool beginsWith = true ) : IEnumerable

Searches for convars containing the specified substring and returns a collection of matches.

SendCommandAsync ( DeveloperCommands.Context context, string command ) : void

Executes a command string asynchronously under the specified context.

SendCommandAsync ( string command ) : void

Executes a command string asynchronously under the default context.

Submit ( DeveloperCommands.Context context, string command ) : void

Executes a command string under the specified context.

Submit ( string command ) : void

Executes a command string under the default context.

TranslateCommand ( DeveloperCommands.Context context, string command ) : DeveloperCommands.Call

Translates a command string into a reusable Call object.

Method Details

CreateCommand() public static method

Creates a new command using the specified method, metadata, and an optional filter.
public static CreateCommand ( MethodInfo method, string name, string description, string category, DeveloperCommands.ContextFilter filter = null ) : DeveloperCommands.Command
method System.Reflection.MethodInfo The method to associate with the command.
name string The name of the command.
description string The description of the command.
category string The category under which to place the command.
filter DeveloperCommands.ContextFilter The filter rules to apply to the command.
return DeveloperCommands.Command

Load() public static method

Scans all assemblies in the current application domain, and their references, for command/convar definitions.
public static Load ( bool loadConfig = true ) : void
loadConfig bool Indicates if the engine should load a configuration file.
return void

Log() public static method

Prints an object's string value to the Devcom output.
public static Log ( object value ) : void
value object The value to print.
return void

SaveConfig() public static method

Saves the current configuration of the engine.
public static SaveConfig ( ) : void
return void

SearchCommands() public static method

Searches for commands containing the specified substring and returns a collection of matches.
public static SearchCommands ( string query, bool beginsWith = true ) : IEnumerable
query string The query to search for.
beginsWith bool Indicates if the search should only return results that begin with the query.
return IEnumerable

SearchConvars() public static method

Searches for convars containing the specified substring and returns a collection of matches.
public static SearchConvars ( string query, bool beginsWith = true ) : IEnumerable
query string The query to search for.
beginsWith bool Indicates if the search should only return results that begin with the query.
return IEnumerable

SendCommandAsync() public static method

Executes a command string asynchronously under the specified context.
public static SendCommandAsync ( DeveloperCommands.Context context, string command ) : void
context DeveloperCommands.Context The context under which to execute the command.
command string The command to execute.
return void

SendCommandAsync() public static method

Executes a command string asynchronously under the default context.
public static SendCommandAsync ( string command ) : void
command string The command to execute.
return void

Submit() public static method

Executes a command string under the specified context.
public static Submit ( DeveloperCommands.Context context, string command ) : void
context DeveloperCommands.Context The context under which to execute the command.
command string The command to execute.
return void

Submit() public static method

Executes a command string under the default context.
public static Submit ( string command ) : void
command string The command to execute.
return void

TranslateCommand() public static method

Translates a command string into a reusable Call object.
public static TranslateCommand ( DeveloperCommands.Context context, string command ) : DeveloperCommands.Call
context DeveloperCommands.Context The context to attach to the call.
command string The command string to translate.
return DeveloperCommands.Call

Property Details

OnPrint public_oe static_oe property

If assigned, this callback will be executed when Print() is called.
public static PrintCallback OnPrint
return PrintCallback