IdleStateProvider Class
The source of the idle state of the user and of the screen (https://wicg.github.io/idle-detection/), read by the IdleDetector objects of the browsing contexts that share a BrowsingContextOptions (IdleDetectionOptions.Provider). The default implementation returns IdleStateProvider.Status, set by the application. Override IdleStateProvider.GetStatus to read another source, and call IdleStateProvider.OnStatusChanged when the status changes, to update the detectors.
public class IdleStateProviderRemarks
A provider can be shared by several browsing contexts, and used from any thread.
Constructors
| Name | Description |
|---|---|
| IdleStateProvider() |
IdleStateProvider()
IdleDetection.cspublic IdleStateProvider()No documentation is available.
Properties
| Name | Description |
|---|---|
| Status | Gets or sets the status returned by the default implementation of IdleStateProvider.GetStatus (IdleStatus.Default by default). Setting it updates the started IdleDetector objects, which fire their change events. |
Status
IdleDetection.csGets or sets the status returned by the default implementation of IdleStateProvider.GetStatus (IdleStatus.Default by default). Setting it updates the started IdleDetector objects, which fire their change events.
public IdleStatus Status { get; set; }Property value
Methods
| Name | Description |
|---|---|
| GetStatus() | Returns the idle status. The default implementation returns IdleStateProvider.Status. It is called on the thread of an event loop, and must not block it. |
| OnStatusChanged() | Raises IdleStateProvider.StatusChanged, then reads the status again for the started IdleDetector objects, which fire their change events. It can be called from any thread. |
GetStatus()
IdleDetection.csReturns the idle status. The default implementation returns IdleStateProvider.Status. It is called on the thread of an event loop, and must not block it.
public virtual IdleStatus GetStatus()Returns
OnStatusChanged()
IdleDetection.csRaises IdleStateProvider.StatusChanged, then reads the status again for the started IdleDetector objects, which fire their change events. It can be called from any thread.
protected void OnStatusChanged()Events
| Name | Description |
|---|---|
| StatusChanged | Raised when the status changes (IdleStateProvider.OnStatusChanged). |
StatusChanged
Raised when the status changes (IdleStateProvider.OnStatusChanged).
public event EventHandler? StatusChanged