Class Script
Inheritance
Namespace: AutoCheck.Core
Assembly: AutoCheck.Core.dll
Syntax
public class Script : object
Constructors
| Improve this Doc View SourceScript(EventHandler<LogUpdateEventArgs>, EventHandler<StatusUpdateEventArgs>)
Declaration
protected Script(EventHandler<LogUpdateEventArgs> onLogUpdate, EventHandler<StatusUpdateEventArgs> onStatusUpdate)
Parameters
Type | Name | Description |
---|---|---|
EventHandler<LogUpdateEventArgs> | onLogUpdate | |
EventHandler<StatusUpdateEventArgs> | onStatusUpdate |
Script(String, EventHandler<LogUpdateEventArgs>, EventHandler<StatusUpdateEventArgs>, Boolean)
Creates a new script instance using the given script file.
Declaration
public Script(string path, EventHandler<LogUpdateEventArgs> onLogUpdate, EventHandler<StatusUpdateEventArgs> onStatusUpdate, bool autoStart = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path to the script file (yaml). |
EventHandler<LogUpdateEventArgs> | onLogUpdate | This event will be fired each time a new log entry has been generated. |
EventHandler<StatusUpdateEventArgs> | onStatusUpdate | This event will be fired fired each time a script completes an execution step (header(1) -> init(1) -> setup() -> copy_detector(1) -> pre() -> body() -> post() -> teardown(*) -> end(1)). |
System.Boolean | autoStart | This script will start just after beeing loaded, otherwise the Start() method should be invoked. |
Script(String, EventHandler<LogUpdateEventArgs>, Boolean)
Declaration
public Script(string path, EventHandler<LogUpdateEventArgs> onLogUpdate, bool autoStart = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | |
EventHandler<LogUpdateEventArgs> | onLogUpdate | |
System.Boolean | autoStart |
Script(String, Boolean)
Declaration
public Script(string path, bool autoStart = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | |
System.Boolean | autoStart |
Properties
| Improve this Doc View SourceAppConfigName
The root app's configuration folder name.
Declaration
protected string AppConfigName { get; }
Property Value
Type | Description |
---|---|
System.String |
AppConfigPath
The current app's configuration folder path.
Declaration
protected string AppConfigPath { get; }
Property Value
Type | Description |
---|---|
System.String |
AppFolderName
The root app's execution folder name.
Declaration
protected string AppFolderName { get; }
Property Value
Type | Description |
---|---|
System.String |
AppFolderPath
The root app's execution folder path.
Declaration
protected string AppFolderPath { get; }
Property Value
Type | Description |
---|---|
System.String |
AppTempName
The root app's temporary folder name.
Declaration
protected string AppTempName { get; }
Property Value
Type | Description |
---|---|
System.String |
AppTempPath
The current app's temporary folder path.
Declaration
protected string AppTempPath { get; }
Property Value
Type | Description |
---|---|
System.String |
AppUtilsName
The root app's utils folder name.
Declaration
protected string AppUtilsName { get; }
Property Value
Type | Description |
---|---|
System.String |
AppUtilsPath
The current app's utils folder path.
Declaration
protected string AppUtilsPath { get; }
Property Value
Type | Description |
---|---|
System.String |
BatchCaption
The current script caption defined within the YAML file.
Declaration
protected string BatchCaption { get; }
Property Value
Type | Description |
---|---|
System.String |
Concurrent
Batch mode only: maximum concurrent script execution (0 = MAX).
Declaration
protected int Concurrent { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
CurrentDirSeparator
The host name or IP address for the current execution.
Declaration
protected char CurrentDirSeparator { get; }
Property Value
Type | Description |
---|---|
System.Char |
CurrentFileName
The current file name where the script is targeting right now (local or remote); can change during the execution for batch-typed.
Declaration
protected string CurrentFileName { get; }
Property Value
Type | Description |
---|---|
System.String |
CurrentFilePath
The current file path where the script is targeting right now (local or remote); can change during the execution for batch-typed.
Declaration
protected string CurrentFilePath { get; }
Property Value
Type | Description |
---|---|
System.String |
CurrentFolderName
The current folder name where the script is targeting right now (local or remote); can change during the execution for batch-typed.
Declaration
protected string CurrentFolderName { get; }
Property Value
Type | Description |
---|---|
System.String |
CurrentFolderPath
The current folder path where the script is targeting right now (local or remote); can change during the execution for batch-typed.
Declaration
protected string CurrentFolderPath { get; }
Property Value
Type | Description |
---|---|
System.String |
CurrentHost
The host name or IP address for the current execution.
Declaration
protected string CurrentHost { get; }
Property Value
Type | Description |
---|---|
System.String |
CurrentOS
The current OS family.
Declaration
protected Utils.OS CurrentOS { get; }
Property Value
Type | Description |
---|---|
Utils.OS |
CurrentPassword
The password for the current execution.
Declaration
protected string CurrentPassword { get; }
Property Value
Type | Description |
---|---|
System.String |
CurrentPort
The port for the current execution.
Declaration
protected int CurrentPort { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
CurrentQuestion
The current question (and subquestion) number (1, 2, 2.1, etc.)
Declaration
protected string CurrentQuestion { get; }
Property Value
Type | Description |
---|---|
System.String |
CurrentScore
The current question (and subquestion) score
Declaration
protected float CurrentScore { get; }
Property Value
Type | Description |
---|---|
System.Single |
CurrentTarget
Only for batch mode: returns the kind of the current batch execution: none
, local
or remote
.
Declaration
protected string CurrentTarget { get; }
Property Value
Type | Description |
---|---|
System.String |
CurrentUser
The username for the current execution.
Declaration
protected string CurrentUser { get; }
Property Value
Type | Description |
---|---|
System.String |
ExecutionFolderName
The current app's execution folder name.
Declaration
protected string ExecutionFolderName { get; }
Property Value
Type | Description |
---|---|
System.String |
ExecutionFolderPath
The current app's execution folder path.
Declaration
protected string ExecutionFolderPath { get; }
Property Value
Type | Description |
---|---|
System.String |
LogFileName
The current log file (the file name)
Declaration
protected string LogFileName { get; }
Property Value
Type | Description |
---|---|
System.String |
LogFilePath
The current log file (the entire path)
Declaration
protected string LogFilePath { get; }
Property Value
Type | Description |
---|---|
System.String |
LogFiles
Output instance used to display messages.
Declaration
public List<string> LogFiles { get; }
Property Value
Type | Description |
---|---|
List<System.String> |
LogFolderName
The current log folder (the folder name)
Declaration
protected string LogFolderName { get; }
Property Value
Type | Description |
---|---|
System.String |
LogFolderPath
The current log folder (the entire path)
Declaration
protected string LogFolderPath { get; }
Property Value
Type | Description |
---|---|
System.String |
MaxScore
Maximum score possible
Declaration
protected float MaxScore { get; }
Property Value
Type | Description |
---|---|
System.Single |
Now
The current datetime.
Declaration
protected string Now { get; }
Property Value
Type | Description |
---|---|
System.String |
Output
Output instance used to display messages.
Declaration
public Output Output { get; }
Property Value
Type | Description |
---|---|
Output |
Result
Last executed command's result.
Declaration
protected string Result { get; }
Property Value
Type | Description |
---|---|
System.String |
ScriptCaption
The current script caption defined within the YAML file.
Declaration
protected string ScriptCaption { get; }
Property Value
Type | Description |
---|---|
System.String |
ScriptFileName
The script file name.
Declaration
protected string ScriptFileName { get; }
Property Value
Type | Description |
---|---|
System.String |
ScriptFilePath
The script file path.
Declaration
protected string ScriptFilePath { get; }
Property Value
Type | Description |
---|---|
System.String |
ScriptFolderName
The script folder name.
Declaration
protected string ScriptFolderName { get; }
Property Value
Type | Description |
---|---|
System.String |
ScriptFolderPath
The script folder path.
Declaration
protected string ScriptFolderPath { get; }
Property Value
Type | Description |
---|---|
System.String |
ScriptName
The current script name defined within the YAML file, otherwise the YAML file name.
Declaration
protected string ScriptName { get; }
Property Value
Type | Description |
---|---|
System.String |
ScriptVersion
The current script version defined within the YAML file, otherwise the YAML file name.
Declaration
protected string ScriptVersion { get; }
Property Value
Type | Description |
---|---|
System.String |
SingleCaption
The current script caption defined within the YAML file.
Declaration
protected string SingleCaption { get; }
Property Value
Type | Description |
---|---|
System.String |
TotalScore
The accumulated score (over 10 points), which will be updated on each CloseQuestion() call.
Declaration
protected float TotalScore { get; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
| Improve this Doc View SourceForEachChild<T>(YamlNode, Action<String, T>, Boolean)
Declaration
protected void ForEachChild<T>(YamlNode node, Action<string, T> action, bool parseEmpty = true)
where T : YamlNode
Parameters
Type | Name | Description |
---|---|---|
YamlNode | node | |
Action<System.String, T> | action | |
System.Boolean | parseEmpty |
Type Parameters
Name | Description |
---|---|
T |
GetTargetData()
Returns the current YAML
Declaration
public Dictionary<string, object> GetTargetData()
Returns
Type | Description |
---|---|
Dictionary<System.String, System.Object> |
LoadYamlFile(String)
Declaration
protected YamlStream LoadYamlFile(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path |
Returns
Type | Description |
---|---|
YamlStream |
OverrideTarget(Dictionary<String, String>, Dictionary<String, String>)
Overrides the current target data with the given one.
Declaration
public void OverrideTarget(Dictionary<string, string> target, Dictionary<string, string> vars = null)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<System.String, System.String> | target | Target data to override. |
Dictionary<System.String, System.String> | vars | Vars data to override. |
Start()
Manually starts the script execution
Declaration
public void Start()