当前位置: 首页>>代码示例>>C#>>正文


C# TaskExecutionNode.Flatten方法代码示例

本文整理汇总了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;
            }
        }
开发者ID:JAllman,项目名称:machine.specifications.runner.resharper,代码行数:35,代码来源:RecursiveMSpecTaskRunner.cs

示例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);
            }
        }
开发者ID:sergeyt,项目名称:karma-resharper,代码行数:27,代码来源:JUnitReporter.cs

示例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);
      }
    }
开发者ID:hennys,项目名称:machine.specifications,代码行数:36,代码来源:RecursiveMSpecTaskRunner.cs

示例4: ExecuteRecursive

 public override void ExecuteRecursive(TaskExecutionNode node)
 {
   node.Flatten(x => x.Children).Each(RegisterRemoteTaskNotifications);
 }
开发者ID:hennys,项目名称:machine.specifications,代码行数:4,代码来源:RecursiveMSpecTaskRunner.cs


注:本文中的TaskExecutionNode.Flatten方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。