public async Task <bool> Deploy(BuildNode InBuild) { CancellationTaskTokenSource = new CancellationTokenSource(); var Build = new BuildNode(InBuild.UseBuild, InBuild.Number, InBuild.Timestamp, InBuild.Path, InBuild.Platform, InBuild.Solution, InBuild.Role, InBuild.AutomatedTestStatus); Devices[0].ProjectConfig = WinForm.GetProject(Build); Devices[0].Build = Build; ThreadHelperClass.DeployBuild(WinForm, DeviceView, Devices[0]); DeploymentTask = Task.Run(() => Devices[0].DeployBuild(Build, this, CancellationTaskTokenSource.Token), CancellationTaskTokenSource.Token); await DeploymentTask; return(DeploymentTask.Result); }
private bool DeployBuild(BuildNode InBuild, IDeploymentSession Callback, CancellationToken Token) { foreach (var Device in Devices) { var Build = new BuildNode(InBuild.UseBuild, InBuild.Number, InBuild.Timestamp, InBuild.Path, InBuild.Platform, InBuild.Solution, InBuild.Role, InBuild.AutomatedTestStatus); Device.Build = Build; Build.Status = "Waiting for Device"; ThreadHelperClass.DeployBuild(WinForm, DeviceView, Device); } foreach (var Device in Devices) { Device.ProjectConfig = WinForm.GetProject(Device.Build); Device.DeployBuild(Device.Build, Callback, Token); } return(true); }