C# 클래스 Nexus.Client.ModManagement.Scripting.CSharpScript.CSharpScriptExecutor

Executes a C# script.
상속: ScriptExecutorBase
파일 보기 프로젝트 열기: NexusMods/NexusModManager-4.5

공개 메소드들

메소드 설명
CSharpScriptExecutor ( IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, CSharpScriptFunctionProxy p_csfFunctions, Type p_tpeBaseScriptType ) : System

A simple constructor that initializes the object with the given values.

DoExecute ( IScript p_scpScript ) : bool

Executes the script.

보호된 메소드들

메소드 설명
Compile ( string p_strCode ) : byte[]

Compiles the given C# script code.

The compiled script is not loaded into the current domain.

CreateSandbox ( IScript p_scpScript ) : AppDomain

Creates a sandboxed domain.

The sandboxed domain is only given permission to alter the parts of the system that are relevant to mod management for the current game mode.

비공개 메소드들

메소드 설명
CurrentDomain_AssemblyResolve ( object sender, ResolveEventArgs args ) : Assembly

Handles the AppDomain.AssemblyResolve event.

Assemblies that have been load dynamically aren't accessible by assembly name. So, when, for example, this class looks for the assembly containing the ScriptRunner type that was CreateInstanceFromAndUnwrap-ed, the class can't find the type. This handler searches through loaded assemblies and finds the required assembly.

Functions_TaskStarted ( object sender, EventArgs e ) : void

Handles the ScriptFunctionProxy.TaskStarted event of script executors.

This bubbles the started task to any listeners.

메소드 상세

CSharpScriptExecutor() 공개 메소드

A simple constructor that initializes the object with the given values.
public CSharpScriptExecutor ( IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, CSharpScriptFunctionProxy p_csfFunctions, Type p_tpeBaseScriptType ) : System
p_gmdGameMode IGameMode The game mode currently being managed.
p_eifEnvironmentInfo IEnvironmentInfo The application's envrionment info.
p_csfFunctions CSharpScriptFunctionProxy The proxy providing the implementations of the functions available to the C# script.
p_tpeBaseScriptType System.Type The type of the base script from which all C# scripts should derive.
리턴 System

Compile() 보호된 메소드

Compiles the given C# script code.
The compiled script is not loaded into the current domain.
protected Compile ( string p_strCode ) : byte[]
p_strCode string The code to compile.
리턴 byte[]

CreateSandbox() 보호된 메소드

Creates a sandboxed domain.
The sandboxed domain is only given permission to alter the parts of the system that are relevant to mod management for the current game mode.
protected CreateSandbox ( IScript p_scpScript ) : AppDomain
p_scpScript IScript The script we are going to execute. This is required so we can include /// the folder containing the script's script type class in the sandboxes PrivateBinPath. /// We need to do this so that any helper classes and libraries used by the script /// can be found.
리턴 System.AppDomain

DoExecute() 공개 메소드

Executes the script.
Thrown if is not a /// .
public DoExecute ( IScript p_scpScript ) : bool
p_scpScript IScript The C# Script to execute.
리턴 bool