Class UserScriptExecutionContext
Inheritance
UserScriptExecutionContext
Assembly: SociallyDistant.Framework.dll
Syntax
public sealed class UserScriptExecutionContext : IScriptExecutionContext
Constructors
UserScriptExecutionContext()
Declaration
public UserScriptExecutionContext()
Properties
FileSystem
Gets a reference to the shell's file system. If null, glob patterns won't be expanded.
Declaration
public IVirtualFileSystem? FileSystem { get; set; }
Property Value
Home
Gets a path to the user's home directory. If null, there is no home directory and '~' characters will not be expanded to it.
Declaration
public string? Home { get; set; }
Property Value
ModuleManager
Declaration
public ScriptModuleManager ModuleManager { get; }
Property Value
Title
Declaration
public string Title { get; set; }
Property Value
WorkingDirectory
Gets a path to the current working directory. If none is specified, "/" will be used instead.
Declaration
public string? WorkingDirectory { get; set; }
Property Value
Methods
DeclareFunction(string, IScriptFunction)
Declaration
public void DeclareFunction(string name, IScriptFunction body)
Parameters
GetVariableValue(string)
Declaration
public string GetVariableValue(string variableName)
Parameters
Type |
Name |
Description |
string |
variableName |
|
Returns
HandleCommandNotFound(string, string[], IConsoleDriver)
Declaration
public void HandleCommandNotFound(string name, string[] args, IConsoleDriver console)
Parameters
OpenFileConsole(IConsoleDriver, string, FileRedirectionType)
Declaration
public IConsoleDriver OpenFileConsole(IConsoleDriver realConsole, string filePath, FileRedirectionType mode)
Parameters
Returns
SetVariableValue(string, string)
Declaration
public void SetVariableValue(string variableName, string value)
Parameters
TryExecuteCommandAsync(string, string[], IConsoleDriver, IScriptExecutionContext?)
Declaration
public Task<int?> TryExecuteCommandAsync(string name, string[] args, IConsoleDriver console, IScriptExecutionContext? callSite = null)
Parameters
Returns
Events
OnCommandNotFound
Declaration
public event Action<string, IConsoleDriver>? OnCommandNotFound
Event Type
Implements