BackgroundTransferGroup BackgroundTransferGroup BackgroundTransferGroup BackgroundTransferGroup Class

A named group used to associate multiple download or upload operations. This class makes it easy for your app to create these groups and to complete downloads and uploads simultaneously, in serial, or based on priority.

For example, if a user decides to download and watch episodes from a popular television series, your app can prioritize the earliest episodes in the series or let the user choose which episode to download first.

Syntax

Declaration

public sealed class BackgroundTransferGrouppublic sealed class BackgroundTransferGroupPublic NotInheritable Class BackgroundTransferGroup

Remarks

A BackgroundTransferGroup object can persist to support transfer operations that span app sessions. New methods have been introduced to BackgroundDownloader, BackgroundUploader, DownloadOperation, and UploadOperation to simplify accessing groups created in a previous app session.

Note

Up to 50 unique transfer groups per app are supported.

Properties summary

Gets the name of the group.

Gets or sets the property used to specify if transfers within this group run simultaneously or in serial. Possible values are defined by BackgroundTransferBehavior.

Methods summary

Creates a transfer group using the provided group name.

Properties

  • Name
    Name
    Name
    Name

    Gets the name of the group.

    public string Name { get; }public string Name { get; }Public ReadOnly Property Name As string

    Property Value

    • string
      string
      string
      string

      The group name.

  • TransferBehavior
    TransferBehavior
    TransferBehavior
    TransferBehavior

    Gets or sets the property used to specify if transfers within this group run simultaneously or in serial. Possible values are defined by BackgroundTransferBehavior.

    public BackgroundTransferBehavior TransferBehavior { get; set; }public BackgroundTransferBehavior TransferBehavior { get; set; }Public ReadWrite Property TransferBehavior As BackgroundTransferBehavior

    Property Value

    Remarks

    When using Background Transfer during development, you may get into a situation where the internal caches of active and completed transfer operations can get out of sync. This may result in the inability to start new transfer operations or interact with existing operations and BackgroundTransferGroup objects. In some cases, attempting to interact with existing operations may trigger a crash. This result can occur if the TransferBehavior property is set to Parallel. This issue occurs only in certain scenarios during development and is not applicable to end users of your app. For more Information, see the Debugging Guidance section in BackgroundDownloader and BackgroundUploader.

Methods

  • CreateGroup(System.String)
    CreateGroup(System.String)
    CreateGroup(System.String)
    CreateGroup(System.String)

    Creates a transfer group using the provided group name.

    public static BackgroundTransferGroup CreateGroup(System.String name)public static BackgroundTransferGroup CreateGroup(System.String name)Public Static Function CreateGroup(name As System.String) As BackgroundTransferGroup

    Parameters

    • name
      System.String
      System.String
      System.String
      System.String

      The name of the group. If a group with the this name already exists, this method will return a reference to the existing group object.

    Returns

    Remarks

    A BackgroundTransferGroup object can persist to support transfer operations that span app sessions. New methods have been introduced to BackgroundDownloader, BackgroundUploader, DownloadOperation, and UploadOperation to simplify accessing groups created in a previous app session.

    Note

    Windows 8.1 and Windows Server 2012 R2 support a maximum of 50 unique transfer groups for the entire system. So an app should reuse a unique ID or a small number of unique IDs for all transfer groups created by the app. If more than 50 transfer groups are created on the system, the app will get in an unrecoverable state.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.Networking.BackgroundTransfer.dll