Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/04/17 17:19:35 (7 years ago)
Author:
gkronber
Message:

#2520: changed all usages of StorableClass to use StorableType with an auto-generated GUID (did not add StorableType to other type definitions yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceReintegration/HeuristicLab.Clients.Hive/3.3/HiveClient.cs

    r14901 r14927  
    9999          jobs.Add(new RefreshableJob(j));
    100100        }
    101       }
    102       catch {
     101      } catch {
    103102        jobs = null;
    104103        throw;
    105       }
    106       finally {
     104      } finally {
    107105        OnRefreshed();
    108106      }
     
    110108
    111109    public void RefreshAsync(Action<Exception> exceptionCallback) {
    112       var call = new Func<Exception>(delegate() {
     110      var call = new Func<Exception>(delegate () {
    113111        try {
    114112          Refresh();
    115         }
    116         catch (Exception ex) {
     113        } catch (Exception ex) {
    117114          return ex;
    118115        }
    119116        return null;
    120117      });
    121       call.BeginInvoke(delegate(IAsyncResult result) {
     118      call.BeginInvoke(delegate (IAsyncResult result) {
    122119        Exception ex = call.EndInvoke(result);
    123120        if (ex != null) exceptionCallback(ex);
     
    146143    }
    147144    public static void StoreAsync(Action<Exception> exceptionCallback, IHiveItem item, CancellationToken cancellationToken) {
    148       var call = new Func<Exception>(delegate() {
     145      var call = new Func<Exception>(delegate () {
    149146        try {
    150147          Store(item, cancellationToken);
    151         }
    152         catch (Exception ex) {
     148        } catch (Exception ex) {
    153149          return ex;
    154150        }
    155151        return null;
    156152      });
    157       call.BeginInvoke(delegate(IAsyncResult result) {
     153      call.BeginInvoke(delegate (IAsyncResult result) {
    158154        Exception ex = call.EndInvoke(result);
    159155        if (ex != null) exceptionCallback(ex);
     
    294290        }
    295291        TS.Task.WaitAll(tasks.ToArray());
    296       }
    297       finally {
     292      } finally {
    298293        refreshableJob.Job.Modified = false;
    299294        refreshableJob.IsProgressing = false;
     
    394389        taskUploadSemaphore.Release(); semaphoreReleased = true; // the semaphore has to be release before waitall!
    395390        TS.Task.WaitAll(tasks.ToArray());
    396       }
    397       finally {
     391      } finally {
    398392        if (!semaphoreReleased) taskUploadSemaphore.Release();
    399393      }
     
    443437        } else if (refreshableJob.IsPaused()) {
    444438          refreshableJob.ExecutionState = Core.ExecutionState.Paused;
    445         } else { 
     439        } else {
    446440          refreshableJob.ExecutionState = Core.ExecutionState.Started;
    447441        }
    448442        refreshableJob.OnLoaded();
    449       }
    450       finally {
     443      } finally {
    451444        refreshableJob.IsProgressing = false;
    452445        refreshableJob.Progress.Finish();
     
    485478      try {
    486479        return PersistenceUtil.Deserialize<ItemTask>(taskData.Data);
    487       }
    488       catch {
     480      } catch {
    489481        return null;
    490482      }
     
    497489    public static void TryAndRepeat(Action action, int repetitions, string errorMessage, ILog log = null) {
    498490      while (true) {
    499         try { action(); return; }
    500         catch (Exception e) {
     491        try { action(); return; } catch (Exception e) {
    501492          if (repetitions == 0) throw new HiveException(errorMessage, e);
    502493          if (log != null) log.LogMessage(string.Format("{0}: {1} - will try again!", errorMessage, e.ToString()));
Note: See TracChangeset for help on using the changeset viewer.