Amazon.S3.Util.AmazonS3Util.EndDeleteS3BucketWithObjects C# (CSharp) Method

EndDeleteS3BucketWithObjects() public static method

Finishes the asynchronous execution of the DeleteS3BucketWithObjects operation.
public static EndDeleteS3BucketWithObjects ( IAsyncCancelableResult asyncCancelableResult ) : void
asyncCancelableResult IAsyncCancelableResult The IAsyncCancelableResult returned by the call to BeginDeleteS3BucketWithObjects.
return void
        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();
            }
        }