Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/21/11 17:35:42 (14 years ago)
Author:
cneumuel
Message:

#1233

  • fixed handling of StateLog in DataLayer
  • extended unit tests
  • changed style of service calls to OKB-like style (using delegates)
  • added possibility that parent jobs can be finished immediately when child jobs are finished
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentManagerClient.cs

    r5402 r5526  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Linq;
    2425using HeuristicLab.Collections;
    2526using HeuristicLab.Core;
    26 using HeuristicLab.Services.Hive.Common.ServiceContracts;
    27 using HeuristicLab.Services.Hive.Common;
    28 using System.Collections.Generic;
    2927
    3028namespace HeuristicLab.Clients.Hive {
     29  using HeuristicLab.Common;
    3130  using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
    32   using HeuristicLab.Common;
    33   using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    34   using HeuristicLab.Clients.Common;
    3531
    3632  [Item("Hive Client", "Connects to Hive and lists all submitted experiments by the current user.")]
     
    9793          this.HiveExperiments = new ItemList<HiveExperimentClient>();
    9894        }
    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;
    106100      }
    107101      catch (Exception) {
     
    137131    }
    138132
    139     void hiveExperiments_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveExperimentClient>> e) {
     133    private void hiveExperiments_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveExperimentClient>> e) {
    140134      if (!currentlyUpdating) {
    141         using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
     135        ServiceLocator.Instance.CallHiveService(service => {
    142136          foreach (IndexedItem<HiveExperimentClient> item in e.Items) {
    143137            if (item.Value.HiveExperimentId != Guid.Empty) {
    144               service.Obj.DeleteHiveExperiment(item.Value.HiveExperimentId);
     138              service.DeleteHiveExperiment(item.Value.HiveExperimentId);
    145139            }
    146140          }
    147         }
     141        });
    148142      }
    149143    }
Note: See TracChangeset for help on using the changeset viewer.