/// <summary> /// Schedules the task for execution. /// </summary> public void ScheduleTask(Task[] dependencyTasks) { var tasks = DependencyControls .Select(control => control.Task) .Concat(dependencyTasks ?? new Task[0]) .ToArray(); Control.ContinueWhenAll(tasks, ExecuteTask); }
protected override void ExecuteTask() { var anyDependencyFailed = DependencyControls .Select(control => control.Task) .Any(task => task.IsCanceled || task.IsFaulted); if (anyDependencyFailed) { Control.Cancel().ThrowIfCancellationRequested(); } foreach (var solutionPath in System.IO.Directory.GetFiles(Directory, "*.sln", SearchOption.AllDirectories)) { Control.CancellationToken.ThrowIfCancellationRequested(); var log = BuildService.Build(solutionPath, Platform); Control.Log = string.Join(Environment.NewLine, log); } }