コード例 #1
0
 /// <summary>
 /// Creates a new instance
 /// </summary>
 /// <param name="processId">The process id</param>
 /// <param name="state">The status of the process</param>
 public TransformationProcessStatus(Guid processId, TransformationExecutionState state)
 {
     ProcessId = processId;
     State     = state;
 }
コード例 #2
0
        /// <summary>
        /// Sets the state of the process
        /// </summary>
        /// <param name="status">The process status</param>
        /// <param name="token">Cancellation token to use, if any</param>
        /// <returns>The updated process status</returns>
        protected virtual async Task <TransformationProcessStatus> ChangeProcessStatusAsync(TransformationExecutionState status, CancellationToken token)
        {
            // NOTE: This one returns the TransformationProcessStatus, while the next one doesn't (for the task)
            // Evaluate a different and more consistent approach

            var newStatus = new TransformationProcessStatus(Id, status);
            await TransformationStateManager
            .WriteProcessStatusAsync(newStatus, token)
            .ConfigureAwait(false);

            await RaiseProgressAsync(newStatus).ConfigureAwait(false);

            return(newStatus);
        }
コード例 #3
0
 private Task ChangeProcessStateAsync(TransformationExecutionState state)
 {
     status = new TransformationProcessStatus(Id, state);
     return(RaiseProgressAsync(status));
 }