Find Method
Collapse the table of content
Expand the table of content

BackgroundTransferService.Find Method

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

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

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

public static BackgroundTransferRequest Find(
	string requestId
)

Parameters

requestId
Type: System.String
The ID specifying the transfer request that is being sought.

Return Value

Type: Microsoft.Phone.BackgroundTransfer.BackgroundTransferRequest
Returns BackgroundTransferRequest. The transfer request associated with the specified ID or NULL if a transfer request with the specified ID cannot be found in the queue.

When you call this method, a new instance of BackgroundTransferRequest is created. To help prevent memory leaks, we recommend that you avoid calling this method frequently, such as in a game loop, to query for a request. We also recommend that you dispose of the returned object quickly, as soon as you are no longer using it.

The unique identifier for a transfer request is generated when a new request is created and is accessed through the RequestId property.

This method may throw one of the following exceptions.

ArgumentNullException

The request ID cannot be null.

InvalidOperationException

The request has previously been cancelled.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2017 Microsoft