C# Class NppSharp.Script

Instance of a single script or assembly.
Mostrar archivo Open project: cmrazek/NppSharp

Public Methods

Method Description
AddCommand ( ) : void

Adds a commands in the assembly to the plugin menu.

CompileScript ( string fileName ) : Script

Compiles a .cs script, and processes the assembly.

Execute ( object data ) : void

Called when the user wants to execute a command.

LoadAssembly ( string fileName ) : Script

Loads a pre-compiled assembly and processes it.

Private Methods

Method Description
Compile ( ) : bool

Compiles a .cs script file, and processes the assembly.

GetSupportedParameter ( ParameterInfo pi ) : object

Produces the value that will be used to populate a parameter for a command method.

IsParameterSupported ( ParameterInfo paramInfo ) : bool

Determines if a parameter can be populated by the plugin when executing a command method. Methods with unsupported parameters will not be eligible to be a command.

LoadDll ( ) : bool

Loads a pre-compiled assembly, and processes it.

ProcessAssembly ( ) : bool

Searches for classes and methods in the assembly to locate potential commands. Public methods that don't have any 'unsupported' parameters will be considered to be commands.

ProcessLexerClass ( Type type ) : void
ProcessScriptClass ( Type type ) : void
ProcessSource ( CodeParser cp ) : bool

Examines a source code file, looking for references in the comments at the top.

Script ( string fileName ) : System

Constructs the script object.

Method Details

AddCommand() public method

Adds a commands in the assembly to the plugin menu.
public AddCommand ( ) : void
return void

CompileScript() public static method

Compiles a .cs script, and processes the assembly.
public static CompileScript ( string fileName ) : Script
fileName string The script's file name.
return Script

Execute() public method

Called when the user wants to execute a command.
public Execute ( object data ) : void
data object The 'tag' object added to the PluginCommand object. For script /// commands, this is set to the CommandMethod object.
return void

LoadAssembly() public static method

Loads a pre-compiled assembly and processes it.
public static LoadAssembly ( string fileName ) : Script
fileName string The assembly's file name.
return Script