This project is read-only.
Most scriptCommands support one or multiple variable keys, that point to variables inside ParameterDic, ScriptCommand access these variables through ParameterDic.GetValue("{variableName}") method.

For examples,
IScriptCommand addCommand = ScriptCommands.Add("{Left}", "{Right}", "{Result}", 

Add scriptcommand take three keys (value1, value2 and destination), the sum of first two variables is stored in destination variable when the script is run.

Noted that all variables are enclosed in a bracket {}.


Similar to WPF, one can use dot (.) in variable to access it's sub-property, field or return value of parameterless method(). Subitem are obtained using reflection, and recursive is supported.

var setPropertyCommand =        
  ScriptCommands.SetProperty("{PSI}", "FileName", "{Value}", 
		ScriptCommands.SetPropertyValue("{PSI}", (ProcessStartInfo p) => p.FileName, "GHI.txt", 

await ScriptRunner.RunScriptAsync(new ParameterDic() { 
                { "PSI", new ProcessStartInfo() { FileName = "ABC.txt" } },
				{ "Value", "DEF.txt" }
            }, setPropertyCommand);

One can assign a disk based or a global static ParameterDic as a variable in the running ParameterDic, see SubParameterDic.

Last edited Oct 18, 2014 at 9:56 AM by lycj, version 3


No comments yet.