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