C# Класс SensorbergSDK.BackgroundTaskManager

Manager class for the Background work.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

CheckIfBackgroundFilterUpdateIsRequired() публичный статический Метод

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
Результат bool

RegisterBackgroundTaskAsync() публичный Метод

Register background tasks, by the given configuration.
public RegisterBackgroundTaskAsync ( SdkConfiguration configuration ) : Task
configuration SdkConfiguration Configuration for the new registration.
Результат Task

RegisterOnProgressEventHandler() публичный Метод

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
Результат void

RegisterTimedBackgroundTask() публичный Метод

Registers the timed background task.
public RegisterTimedBackgroundTask ( string timerClassName ) : BackgroundTaskRegistrationResult
timerClassName string Classname of the timer background service.
Результат BackgroundTaskRegistrationResult

UnRegisterOnProgressEventHandler() публичный Метод

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
Результат void

UnregisterBackgroundTask() публичный Метод

Unregister all backgroundtasks.
public UnregisterBackgroundTask ( ) : void
Результат void

UpdateBackgroundTaskAsync() публичный Метод

Renew the registrations of the background taks.
public UpdateBackgroundTaskAsync ( SdkConfiguration configuration ) : Task
configuration SdkConfiguration Configuration for the new registration.
Результат Task