コード例 #1
0
 private static void HandleError(OperationBase op, ref Exception error)
 {
     if (op.HasError)
     {
         error = op.Error;
         op.MarkErrorAsHandled();
     }
 }
コード例 #2
0
        /// <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();
            }
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
        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));
            }
        }
コード例 #5
0
        /// <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();
            }
        }
コード例 #6
0
ファイル: DetailsProxy.cs プロジェクト: 66160/JobMeasure
        private bool ProcessError(OperationBase op)
        {
            if (op.HasError)
            {
                op.MarkErrorAsHandled();
                Error = op.Error;

                return true;
            }

            return false;
        }
コード例 #7
0
 /// <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();
     }
 }
コード例 #8
0
        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));
            }
        }