Exemple #1
0
        public async Task CommitAsync(IStatus status)
        {
            var commitTask = await statusController.CreateAsync(status, "Commit updated data");

            // commit records controller
            if (recordsController != null)
            {
                var commitRecordsTask = await statusController.CreateAsync(commitTask, "Commit records");

                await recordsController.CommitAsync(status);

                await statusController.CompleteAsync(commitRecordsTask);
            }

            var commitDataTask = await statusController.CreateAsync(commitTask, "Commit items");

            await stashController.SaveAsync(commitDataTask);

            await statusController.CompleteAsync(commitDataTask);

            var additionalCommitsTask = await statusController.CreateAsync(commitTask, "Additional commit dependencies");

            var current = 0;

            foreach (var commitDelegate in additionalCommitDelegates)
            {
                await statusController.UpdateProgressAsync(
                    additionalCommitsTask,
                    ++current,
                    additionalCommitDelegates.Length,
                    "Commit delegate");

                await commitDelegate.CommitAsync(additionalCommitsTask);
            }

            await statusController.CompleteAsync(additionalCommitsTask);

            await statusController.CompleteAsync(commitTask);
        }
Exemple #2
0
 public async Task CommitAsync(IStatus status)
 {
     await indexRecordsController.CommitAsync(status);
 }