private static void HandleError(OperationBase op, ref Exception error) { if (op.HasError) { error = op.Error; op.MarkErrorAsHandled(); } }
/// <summary> /// Handles completion of the underlying operation in the <see cref="DomainContext"/>. /// </summary> /// <param name="operation">The operation that completed</param> private void HandleOperationComplete(OperationBase operation) { WebAsyncResult result = ((WebAsyncResult)operation.UserState); if (operation.HasError) { operation.MarkErrorAsHandled(); } if (!operation.IsCanceled) { result.Complete(); } }
private void OnOperationCompleted(object sender, EventArgs e) { OperationBase operation = (OperationBase)sender; progressIndicator.Visibility = Visibility.Collapsed; operation.Completed -= OnOperationCompleted; if (operation.HasError && (operation.IsErrorHandled == false)) { MessageBox.Show(operation.Error.Message, "Error", MessageBoxButton.OK); operation.MarkErrorAsHandled(); } }
private void RaiseLoadCompleted(OperationBase op) { if (op.HasError) { op.MarkErrorAsHandled(); } AsyncCompletedEventHandler handler = this.LoadCompleted; if (handler != null) { handler(this, new AsyncCompletedEventArgs(op.Error, op.IsCanceled, op.UserState)); } }
/// <summary> /// Handles completion of the underlying operation in the <see cref="DomainContext"/>. /// </summary> /// <param name="operation">The operation that completed</param> private void HandleOperationComplete(OperationBase operation) { WebAsyncResult result = ((WebAsyncResult)operation.UserState); // If the submic callback is executed before the BeginMethod has set InnerOparation // then do so here before calling Complete. // Since there is a race condition otherwise if (result.InnerOperation == null) { result.InnerOperation = operation; } if (operation.HasError) { operation.MarkErrorAsHandled(); } if (!operation.IsCanceled) { result.Complete(); } }
private bool ProcessError(OperationBase op) { if (op.HasError) { op.MarkErrorAsHandled(); Error = op.Error; return true; } return false; }