BackgroundTransferService.Add Method

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

Adds a background transfer request to the queue.

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

Syntax

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

Parameters

Remarks

Each application can have 25 requests queued at a given time. Attempting to add a request after this limit has been reached will throw an exception. It is the responsibility of the application to remove requests from the queue by using the Remove(BackgroundTransferRequest) method after they have completed.

This method may throw one of the following exceptions.

ArgumentNullException

The request argument cannot be null.

InvalidOperationException

The request has already been submitted.

The maximum number of requests per application has been reached.

A request with the same DownloadLocation URI has already been submitted.

The user has disabled background tasks in the device’s Settings.

SystemException

The maximum number of requests on the device has been reached.

The underlying transport layer returned an error.

The underlying transport layer returned an error related to the content-range request or response.

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