Udostępnij za pośrednictwem


BackgroundTransferCompletionGroup Class

Definition

Represents a set of background transfer operations (DownloadOperation or UploadOperation objects) that trigger a background task once all the operations are done (if the operations completed successfully) or fail with an error.

public ref class BackgroundTransferCompletionGroup sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class BackgroundTransferCompletionGroup final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class BackgroundTransferCompletionGroup final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class BackgroundTransferCompletionGroup
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class BackgroundTransferCompletionGroup
function BackgroundTransferCompletionGroup()
Public NotInheritable Class BackgroundTransferCompletionGroup
Inheritance
Object Platform::Object IInspectable BackgroundTransferCompletionGroup
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

The BackgroundTransferCompletionGroup class allows an app to register to receive immediate notification after background transfer operations are complete even if the app is not in the foreground. The app registers a background task to receive notification that occurs if the background transfers completed successfully or if an error occurred. This allows the app to be immediately notified at the time of completion, instead of requiring that the app wait until the next time the app is restarted or moved to the foreground to query for completions.

The app must implement the IBackgroundTask to run that receives the completion notifications. The IBackgroundTask must be registered using the BackgroundTaskBuilder class. When BackgroundTransferCompletionGroup.Trigger is used to set up the task, the Broker Infrastructure will automatically unregister it as soon as it is triggered, so there is no need to have any explicit task unregistration code.

The background task must be declared in the app manifest. The app does not require lock screen access to use a BackgroundTransferCompletionGroup.

Constructors

BackgroundTransferCompletionGroup()

Creates a new BackgroundTransferCompletionGroup object.

Properties

IsEnabled

Gets a value that indicates if Enable method on a BackgroundTransferCompletionGroup has already been called.

Trigger

Gets the IBackgroundTrigger used to set up the background task associated with the BackgroundTransferCompletionGroup.

Methods

Enable()

Indicates that the BackgroundTransferCompletionGroup is complete and no more background transfer operations (DownloadOperation or UploadOperation objects) will be added t the completion group.

Applies to

See also