本文整理汇总了C#中TaskExecutionNode.Flatten方法的典型用法代码示例。如果您正苦于以下问题:C# TaskExecutionNode.Flatten方法的具体用法?C# TaskExecutionNode.Flatten怎么用?C# TaskExecutionNode.Flatten使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskExecutionNode
的用法示例。
在下文中一共展示了TaskExecutionNode.Flatten方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteRecursive
public override void ExecuteRecursive(TaskExecutionNode node)
{
var task = (RunAssemblyTask)node.RemoteTask;
var priorCurrentDirectory = Environment.CurrentDirectory;
try
{
// Use the assembly in the folder that the user has specified, or, if not, use the assembly location
var assemblyFolder = GetAssemblyFolder(TaskExecutor.Configuration, task);
var assemblyPath = new AssemblyPath(Path.Combine(assemblyFolder, GetFileName(task.AssemblyLocation)));
Environment.CurrentDirectory = assemblyFolder;
var listener = new PerAssemblyRunListener(Server, task);
var contextList = new List<string>();
node.Flatten(x => x.Children).Each(children => RegisterRemoteTaskNotifications(listener, children, contextList));
var runOptions = RunOptions.Custom.FilterBy(contextList);
var appDomainRunner = new AppDomainRunner(listener, runOptions);
if (TaskExecutor.Configuration.ShadowCopy)
{
string cachePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
runOptions.ShadowCopyTo(cachePath);
this.Server.SetTempFolderPath(cachePath);
}
appDomainRunner.RunAssembly(assemblyPath);
}
finally
{
Environment.CurrentDirectory = priorCurrentDirectory;
}
}
示例2: Report
public static void Report(XDocument doc, IRemoteTaskServer server, TaskExecutionNode node)
{
var testCases = Parse(doc);
if (testCases == null) return;
var testNodes = from n in node.Flatten(x => x.Children)
where n.RemoteTask is TestTask
select n;
foreach (var testNode in testNodes)
{
var key = GetFullName(testNode);
if (!testCases.ContainsKey(key)) continue;
var testCase = testCases[key];
var task = testNode.RemoteTask;
#if RESHARPER_8
if (testCase.Duration != null)
{
server.TaskDuration(task, testCase.Duration.Value);
}
#endif
server.TaskFinished(task, testCase.Error, testCase.TaskResult);
}
}
示例3: ExecuteRecursive
public override void ExecuteRecursive(TaskExecutionNode node)
{
var task = (RunAssemblyTask) node.RemoteTask;
var contextAssembly = LoadContextAssembly(task);
if (contextAssembly == null)
{
return;
}
var result = VersionCompatibilityChecker.Check(contextAssembly);
if (!result.Success)
{
Server.TaskException(node.RemoteTask, new[] {new TaskException("no type", result.ErrorMessage, null)});
return;
}
var listener = new PerAssemblyRunListener(Server, task);
var runner = new AppDomainRunner(listener, RunOptions.Default);
node.Flatten(x => x.Children).Each(children => RegisterRemoteTaskNotifications(listener, children));
try
{
runner.StartRun(contextAssembly);
foreach (var child in node.Children)
{
RunContext(runner, contextAssembly, child);
}
}
finally
{
runner.EndRun(contextAssembly);
}
}
示例4: ExecuteRecursive
public override void ExecuteRecursive(TaskExecutionNode node)
{
node.Flatten(x => x.Children).Each(RegisterRemoteTaskNotifications);
}