<PackageReference Include="Nito.AsyncEx.Coordination" Version="5.1.2" />

Nito.AsyncEx.PauseTokenSource

public sealed class PauseTokenSource
The source (controller) of a "pause token", which can be used to cooperatively pause and unpause operations.
public bool IsPaused { get; set; }

Whether or not this source (and its tokens) are in the paused state. This member is seldom used; code using this member has a high possibility of race conditions.

public PauseToken Token { get; }

Gets a pause token controlled by this source.