bool RunScriptblockWithParameters( RunScriptBlockWithParameters runnerWithParams, string code, IDictionary <string, string> parameters, IDictionary <string, string> previousTaskResults) { if (string.Empty == code) { return(true); } var scriptblockParameters = new object[] { previousTaskResults ?? new Dictionary <string, string>(), parameters ?? new Dictionary <string, string>() }; try { Trace.TraceInformation("runScriptblockWithParameters.1"); runnerWithParams(ScriptBlock.Create(code), scriptblockParameters); Trace.TraceInformation("runScriptblockWithParameters.2"); return(true); } catch (Exception eOnRunningScriptblock) { // TODO: AOP Trace.TraceError("runScriptblockWithParameters"); // 20141211 Trace.TraceError(eOnRunningScriptblock.Message); return(false); } }
bool RunScriptblockWithParameters( RunScriptBlockWithParameters runnerWithParams, string code, IDictionary<string, string> parameters, IDictionary<string, string> previousTaskResults) { if (string.Empty == code) return true; var scriptblockParameters = new object[] { previousTaskResults ?? new Dictionary<string, string>(), parameters ?? new Dictionary<string, string>() }; try { Trace.TraceInformation("runScriptblockWithParameters.1"); runnerWithParams(ScriptBlock.Create(code), scriptblockParameters); Trace.TraceInformation("runScriptblockWithParameters.2"); return true; } catch (Exception eOnRunningScriptblock) { // TODO: AOP Trace.TraceError("runScriptblockWithParameters"); // 20141211 Trace.TraceError(eOnRunningScriptblock.Message); return false; } }
bool RunCode( string code, IDictionary<string, string> parameters, IDictionary<string, string> previousTaskResults) { Trace.TraceInformation("runCode"); var runnerWithParams = new RunScriptBlockWithParameters(RunSbActionWithParams); return RunScriptblockWithParameters(runnerWithParams, code, parameters, previousTaskResults); }
bool RunCode( string code, IDictionary <string, string> parameters, IDictionary <string, string> previousTaskResults) { Trace.TraceInformation("runCode"); var runnerWithParams = new RunScriptBlockWithParameters(RunSbActionWithParams); return(RunScriptblockWithParameters(runnerWithParams, code, parameters, previousTaskResults)); }