C# Class SensorbergSDK.BackgroundTaskManager

Manager class for the Background work.
Show file Open project: sensorberg-dev/windows10-sdk Class Usage Examples

Public Methods

Method 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

Method 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 method

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
return bool

RegisterBackgroundTaskAsync() public method

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

RegisterOnProgressEventHandler() public method

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
return void

RegisterTimedBackgroundTask() public method

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

UnRegisterOnProgressEventHandler() public method

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
return void

UnregisterBackgroundTask() public method

Unregister all backgroundtasks.
public UnregisterBackgroundTask ( ) : void
return void

UpdateBackgroundTaskAsync() public method

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