BackgroundTransferCompletionGroup
BackgroundTransferCompletionGroup
BackgroundTransferCompletionGroup
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 : sealed class BackgroundTransferCompletionGroup : IBackgroundTransferCompletionGrouppublic sealed class BackgroundTransferCompletionGroup : IBackgroundTransferCompletionGroupPublic NotInheritable Class BackgroundTransferCompletionGroup Implements IBackgroundTransferCompletionGroup// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
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. The background task must be declared in the app manifest. The app does not require lock screen access to use a BackgroundTransferCompletionGroup.
Constructors
BackgroundTransferCompletionGroup() BackgroundTransferCompletionGroup() BackgroundTransferCompletionGroup() BackgroundTransferCompletionGroup()
Creates a new BackgroundTransferCompletionGroup object.
public : BackgroundTransferCompletionGroup()public BackgroundTransferCompletionGroup()Public Sub New()// You can use this method in JavaScript.
Properties
IsEnabled IsEnabled IsEnabled IsEnabled
Gets a value that indicates if Enable method on a BackgroundTransferCompletionGroup has already been called.
public : PlatForm::Boolean IsEnabled { get; }public bool IsEnabled { get; }Public ReadOnly Property IsEnabled As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean bool bool bool
A value that indicates if the Enable method on the BackgroundTransferCompletionGroup has already been called.
- See Also
Trigger Trigger Trigger Trigger
Gets the IBackgroundTrigger used to set up the background task associated with the BackgroundTransferCompletionGroup.
public : IBackgroundTrigger Trigger { get; }public IBackgroundTrigger Trigger { get; }Public ReadOnly Property Trigger As IBackgroundTrigger// You can use this property in JavaScript.
The trigger used to set up the background task associated with the BackgroundTransferCompletionGroup.
Remarks
An IBackgroundTrigger must be used to set up the IBackgroundTask associated with a BackgroundTransferCompletionGroup.
An IBackgroundTrigger can be associated only with one IBackgroundTask.
This property never is NULL.
- See Also
Methods
Enable() Enable() Enable() Enable()
Indicates that the BackgroundTransferCompletionGroup is complete and no more background transfer operations (DownloadOperation or UploadOperation objects) will be added t the completion group.
public : void Enable()public void Enable()Public Function Enable() As void// You can use this method in JavaScript.
Remarks
The Enable method must be called on the BackgroundTransferCompletionGroup to enable the completion group, otherwise the background task associated with the BackgroundTransferCompletionGroup will never be called.
Any attempt to add a DownloadOperation or UploadOperation to the BackgroundTransferCompletionGroup after calling the Enable method will result in an exception.
The Enable method on a BackgroundTransferCompletionGroup can only be called once. An attempt to call the Enable method more than once will result in an exception.