BackgroundTransferService.Remove Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Attempts to remove the background transfer request with the specified ID.

Namespace:  Microsoft.Phone.BackgroundTransfer
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)

Syntax

Public Shared Sub Remove ( _
    request As BackgroundTransferRequest _
)
public static void Remove(
    BackgroundTransferRequest request
)

Parameters

Remarks

Use the Find(String) method to retrieve a BackgroundTransferRequest object associated with a particular request ID. The retrieved object can be passed to Remove to remove it from the system.

After removing a transfer, if the TransferStatus is not already Completed, the TransferStatusChanged event will be fired and the request’s TransferError property will be set to an InvalidOperationException with the message “The request has previously been cancelled.”

This method may throw one of the following exceptions.

ArgumentNullException

The specified BackgroundTransferRequest cannot be null.

InvalidOperationException

The request has previously been cancelled.

The specified transfer request was not found in the queue.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Platforms

Windows Phone

See Also

Reference

BackgroundTransferService Class

Microsoft.Phone.BackgroundTransfer Namespace