Пример #1
0
 public static void StartJob(Action <Exception> exceptionCallback, RefreshableJob refreshableJob, CancellationToken cancellationToken)
 {
     HiveClient.StoreAsync(
         new Action <Exception>((Exception ex) => {
         refreshableJob.ExecutionState = ExecutionState.Prepared;
         exceptionCallback(ex);
     }), refreshableJob, cancellationToken);
     refreshableJob.ExecutionState = ExecutionState.Started;
 }
Пример #2
0
 public static void UpdateJob(Action <Exception> exceptionCallback, RefreshableJob refreshableJob, CancellationToken cancellationToken)
 {
     refreshableJob.IsProgressing    = true;
     refreshableJob.Progress.Message = "Saving Job...";
     HiveClient.StoreAsync(
         new Action <Exception>((Exception ex) => {
         exceptionCallback(ex);
     }), refreshableJob.Job, cancellationToken);
     refreshableJob.IsProgressing = false;
     refreshableJob.Progress.Finish();
 }
Пример #3
0
        public static void UpdateJob(RefreshableJob refreshableJob)
        {
            refreshableJob.IsProgressing = true;

            try {
                refreshableJob.Progress.Start("Saving Job...", ProgressMode.Indeterminate);
                HiveClient.StoreAsync(new Action <Exception>((Exception ex) => {
                    throw new Exception("Update failed.", ex);
                }), refreshableJob.Job, new CancellationToken());
            } finally {
                refreshableJob.IsProgressing = false;
                refreshableJob.Progress.Finish();
            }
        }