/// <summary> /// Finishes the asynchronous execution of the DeleteS3BucketWithObjects operation. /// </summary> /// <param name="asyncCancelableResult">The IAsyncCancelableResult returned by the call to BeginDeleteS3BucketWithObjects.</param> public static void EndDeleteS3BucketWithObjects(IAsyncCancelableResult asyncCancelableResult) { var asyncResult = asyncCancelableResult as AsyncCancelableResult; try { if (!(asyncResult.IsCompleted || asyncResult.IsCanceled)) { asyncResult.AsyncWaitHandle.WaitOne(); } if (asyncResult.LastException != null) { AWSSDKUtils.PreserveStackTrace(asyncResult.LastException); throw asyncResult.LastException; } } finally { asyncResult.Dispose(); } }