Changeset 5526 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentManagerClient.cs
- Timestamp:
- 02/21/11 17:35:42 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentManagerClient.cs
r5402 r5526 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using HeuristicLab.Collections; 25 26 using HeuristicLab.Core; 26 using HeuristicLab.Services.Hive.Common.ServiceContracts;27 using HeuristicLab.Services.Hive.Common;28 using System.Collections.Generic;29 27 30 28 namespace HeuristicLab.Clients.Hive { 29 using HeuristicLab.Common; 31 30 using DT = HeuristicLab.Services.Hive.Common.DataTransfer; 32 using HeuristicLab.Common;33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;34 using HeuristicLab.Clients.Common;35 31 36 32 [Item("Hive Client", "Connects to Hive and lists all submitted experiments by the current user.")] … … 97 93 this.HiveExperiments = new ItemList<HiveExperimentClient>(); 98 94 } 99 using (var service = ServiceLocator.Instance.GetService()) { 100 currentlyUpdating = true; 101 IEnumerable<DT.HiveExperiment> response = service.Obj.GetHiveExperiments(); 102 progress.Status = "Populating HiveExperiment list..."; 103 RefreshExperimentList(response); 104 currentlyUpdating = false; 105 } 95 currentlyUpdating = true; 96 IEnumerable<DT.HiveExperiment> response = ServiceLocator.Instance.CallHiveService(s => s.GetHiveExperiments()); 97 progress.Status = "Populating HiveExperiment list..."; 98 RefreshExperimentList(response); 99 currentlyUpdating = false; 106 100 } 107 101 catch (Exception) { … … 137 131 } 138 132 139 void hiveExperiments_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveExperimentClient>> e) {133 private void hiveExperiments_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveExperimentClient>> e) { 140 134 if (!currentlyUpdating) { 141 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()){135 ServiceLocator.Instance.CallHiveService(service => { 142 136 foreach (IndexedItem<HiveExperimentClient> item in e.Items) { 143 137 if (item.Value.HiveExperimentId != Guid.Empty) { 144 service. Obj.DeleteHiveExperiment(item.Value.HiveExperimentId);138 service.DeleteHiveExperiment(item.Value.HiveExperimentId); 145 139 } 146 140 } 147 } 141 }); 148 142 } 149 143 }
Note: See TracChangeset
for help on using the changeset viewer.