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 IdleStateProvider

Remarks

A provider can be shared by several browsing contexts, and used from any thread.

Constructors

NameDescription
IdleStateProvider()

IdleStateProvider()

IdleDetection.cs
public IdleStateProvider()

No documentation is available.

Properties

NameDescription
StatusGets 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.

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.

public IdleStatus Status { get; set; }

Property value

IdleStatus

Methods

NameDescription
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.cs

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.

public virtual IdleStatus GetStatus()

Returns

IdleStatus

OnStatusChanged()

IdleDetection.cs

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.

protected void OnStatusChanged()

Events

NameDescription
StatusChangedRaised when the status changes (IdleStateProvider.OnStatusChanged).

StatusChanged

Raised when the status changes (IdleStateProvider.OnStatusChanged).

public event EventHandler? StatusChanged