System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary C# (CSharp) Method

RaiseExceptionIfNecessary() protected method

protected RaiseExceptionIfNecessary ( ) : void
return void
        protected void RaiseExceptionIfNecessary()
        {
            if (Error != null)
            {
                throw new TargetInvocationException(SR.Async_ExceptionOccurred, Error);
            }
            else if (Cancelled)
            {
                throw new InvalidOperationException(SR.Async_OperationCancelled);
            }
        }