C# Class SensorbergSDK.BackgroundTaskManager

Manager class for the Background work.
Afficher le fichier Open project: sensorberg-dev/windows10-sdk Class Usage Examples

Méthodes publiques

Méthode Description
CheckIfBackgroundFilterUpdateIsRequired ( ) : bool

Checks if the background filters are up-to-date or not. To update the filters, unregister and register background task again (call BackgroundTaskManager.UpdateBackgroundTaskAsync()).

RegisterBackgroundTaskAsync ( SdkConfiguration configuration ) : Task

Register background tasks, by the given configuration.

RegisterOnProgressEventHandler ( ) : void

Will remove OnProgress event handlers from advertisement background task OnProgress events are used to indicate UI tasks on beacon actions resolved in background.

RegisterTimedBackgroundTask ( string timerClassName ) : BackgroundTaskRegistrationResult

Registers the timed background task.

UnRegisterOnProgressEventHandler ( ) : void

Will remove OnProgress event handlers from advertisement background task OnProgress events are used to indicate UI tasks on beacon actions resolved in background.

UnregisterBackgroundTask ( ) : void

Unregister all backgroundtasks.

UpdateBackgroundTaskAsync ( SdkConfiguration configuration ) : Task

Renew the registrations of the background taks.

Private Methods

Méthode Description
BackgroundTaskRegistered ( string taskName ) : bool

Checks if a background task with the given name is registered.

LoadBackgroundActions ( ) : System.Threading.Tasks.Task
OnAdvertisementWatcherBackgroundTaskCompleted ( IBackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args ) : void

Note: This handler is called only if the task completed while the application was in the foreground.

OnAdvertisementWatcherBackgroundTaskProgress ( BackgroundTaskRegistration sender, BackgroundTaskProgressEventArgs args ) : void
OnTimedBackgroundTaskCompleted ( IBackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args ) : void

Note: This handler is called only if the task completed while the application was in the foreground.

RegisterAdvertisementWatcherBackgroundTaskAsync ( SdkConfiguration configuration ) : Task

Registers the BLE advertisement watcher background task.

Method Details

CheckIfBackgroundFilterUpdateIsRequired() public static méthode

Checks if the background filters are up-to-date or not. To update the filters, unregister and register background task again (call BackgroundTaskManager.UpdateBackgroundTaskAsync()).
public static CheckIfBackgroundFilterUpdateIsRequired ( ) : bool
Résultat bool

RegisterBackgroundTaskAsync() public méthode

Register background tasks, by the given configuration.
public RegisterBackgroundTaskAsync ( SdkConfiguration configuration ) : Task
configuration SdkConfiguration Configuration for the new registration.
Résultat Task

RegisterOnProgressEventHandler() public méthode

Will remove OnProgress event handlers from advertisement background task OnProgress events are used to indicate UI tasks on beacon actions resolved in background.
public RegisterOnProgressEventHandler ( ) : void
Résultat void

RegisterTimedBackgroundTask() public méthode

Registers the timed background task.
public RegisterTimedBackgroundTask ( string timerClassName ) : BackgroundTaskRegistrationResult
timerClassName string Classname of the timer background service.
Résultat BackgroundTaskRegistrationResult

UnRegisterOnProgressEventHandler() public méthode

Will remove OnProgress event handlers from advertisement background task OnProgress events are used to indicate UI tasks on beacon actions resolved in background.
public UnRegisterOnProgressEventHandler ( ) : void
Résultat void

UnregisterBackgroundTask() public méthode

Unregister all backgroundtasks.
public UnregisterBackgroundTask ( ) : void
Résultat void

UpdateBackgroundTaskAsync() public méthode

Renew the registrations of the background taks.
public UpdateBackgroundTaskAsync ( SdkConfiguration configuration ) : Task
configuration SdkConfiguration Configuration for the new registration.
Résultat Task