This topic has not yet been rated - Rate this topic

BackgroundTransferRequest Class

Windows Phone

March 22, 2012

Represents a background file transfer request.

System.Object
  Microsoft.Phone.BackgroundTransfer.BackgroundTransferRequest

Namespace:  Microsoft.Phone.BackgroundTransfer
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)
public sealed class BackgroundTransferRequest : IDisposable

The BackgroundTransferRequest type exposes the following members.

  Name Description
Public method BackgroundTransferRequest(Uri) Initializes a new instance of the BackgroundTransferRequest class with the specified request URI.
Public method BackgroundTransferRequest(Uri, Uri) Initializes a new instance of the BackgroundTransferRequest class with the specified request URI and download file location.
Top
  Name Description
Public property BytesReceived Gets the number of bytes that have been downloaded for the request.
Public property BytesSent Gets the number of bytes that have been uploaded for the request.
Public property DownloadLocation Gets or sets the location to which the requested file will be downloaded.
Public property Headers Gets the dictionary of HTTP headers for the request.
Public property Method Gets or sets the HTTP method for the request.
Public property RequestId Gets the unique identifier associated with the request.
Public property RequestUri Gets the target URI associated with the request.
Public property StatusCode The HTTP status code of the request
Public property Tag Gets or sets additional data associated with the request.
Public property TotalBytesToReceive Gets the total number of bytes that will be downloaded for the request.
Public property TotalBytesToSend Gets the total number of bytes that will be uploaded for the request.
Public property TransferError Gets the exception associated with a failed background transfer request. A transfer request can have a TransferStatus of Completed whether or not the transfer was completed successfully. If a completed transfer was successful, TransferError will be null.
Public property TransferPreferences Gets or sets the preferred conditions under which transfers are enabled.
Public property TransferStatus Gets the status of the request.
Public property UploadLocation Gets or sets the location from which the requested file will be uploaded.
Top
  Name Description
Public method Dispose Releases all resources used by the current instance of the BackgroundTransferRequest class.
Public method Equals(Object) Determines whether this BackgroundTransferRequest is equal to the specified object. (Overrides Object.Equals(Object).)
Public method Equals(BackgroundTransferRequest) Determines whether this BackgroundTransferRequest is equal to the specified object.
Protected method Finalize (Inherited from Object.)
Public method GetHashCode Returns the hash code for this instance. (Overrides Object.GetHashCode().)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString Returns a string representation of the BackgroundTransferRequest object. (Overrides Object.ToString().)
Top
  Name Description
Public event TransferProgressChanged Occurs when the progress of the transfer changes.
Public event TransferStatusChanged Occurs when the TransferStatus property of a request changes.
Top

Create a BackgroundTransferRequest object representing a file transfer request and then use the Add method of the BackgroundTransferService class to register the request with the system. Use the Find method to get a BackgroundTransferRequest object representing a transfer request that has already been submitted to obtain status information about the transfer.

For more information on background file transfers, see Background File Transfers Overview for Windows Phone.

Windows Phone OS

Supported in: 7.1

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Did you find this helpful?
(1500 characters remaining)