- Timestamp:
- 07/10/18 23:06:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r15978 r15992 151 151 }); 152 152 153 UpdateResourceGenealogy();154 UpdateProjectGenealogy();155 UpdateDisabledParentProjects();153 RefreshResourceGenealogy(); 154 RefreshProjectGenealogy(); 155 RefreshDisabledParentProjects(); 156 156 } 157 157 catch { … … 186 186 }); 187 187 188 UpdateResourceGenealogy();189 UpdateProjectGenealogy();190 UpdateDisabledParentProjects();188 RefreshResourceGenealogy(); 189 RefreshProjectGenealogy(); 190 RefreshDisabledParentProjects(); 191 191 } catch { 192 192 projects = null; … … 214 214 } 215 215 216 private void UpdateResourceGenealogy() {216 private void RefreshResourceGenealogy() { 217 217 resourceAncestors.Clear(); 218 218 resourceDescendants.Clear(); … … 234 234 } 235 235 236 private void UpdateProjectGenealogy() {236 private void RefreshProjectGenealogy() { 237 237 projectAncestors.Clear(); 238 238 projectDescendants.Clear(); … … 254 254 } 255 255 256 private void UpdateDisabledParentProjects() {256 private void RefreshDisabledParentProjects() { 257 257 disabledParentProjects = new HashSet<Project>(); 258 258 … … 414 414 415 415 public static void UpdateJob(Action<Exception> exceptionCallback, RefreshableJob refreshableJob, CancellationToken cancellationToken) { 416 HiveServiceLocator.Instance.CallHiveService(service => { 417 HiveClient.StoreAsync( 418 new Action<Exception>((Exception ex) => { 419 //refreshableJob.ExecutionState = ExecutionState.Prepared; 420 exceptionCallback(ex); 421 }), refreshableJob.Job, cancellationToken); 422 }); 423 } 416 refreshableJob.IsProgressing = true; 417 refreshableJob.Progress.Status = "Saving Job..."; 418 HiveClient.StoreAsync( 419 new Action<Exception>((Exception ex) => { 420 exceptionCallback(ex); 421 }), refreshableJob.Job, cancellationToken); 422 refreshableJob.IsProgressing = false; 423 refreshableJob.Progress.Finish(); 424 } 425 426 public static void UpdateJob(RefreshableJob refreshableJob) { 427 refreshableJob.IsProgressing = true; 428 429 try { 430 refreshableJob.Progress.Start("Saving Job..."); 431 HiveClient.StoreAsync(new Action<Exception>((Exception ex) => { 432 throw new Exception("Update failed.", ex); 433 }), refreshableJob.Job, new CancellationToken()); 434 } finally { 435 refreshableJob.IsProgressing = false; 436 refreshableJob.Progress.Finish(); 437 } 438 } 439 440 424 441 425 442 #region Upload Job … … 687 704 }); 688 705 } 706 707 public string GetProjectAncestry(Guid projectId) { 708 if (projectId == null || projectId == Guid.Empty) return ""; 709 var projects = projectAncestors[projectId].Reverse().ToList(); 710 projects.Add(projectId); 711 return string.Join(" » ", projects.Select(x => ProjectNames[x]).ToArray()); 712 } 689 713 } 690 714 }
Note: See TracChangeset
for help on using the changeset viewer.