Table of Contents

Class UtilityExtensions

Namespace
SkyrimForge
Assembly
SkyrimForge.dll

Provides extension members for IUtility.

public static class UtilityExtensions
Inheritance
UtilityExtensions
Inherited Members

Methods

WaitForGameThreadAsync(IUtility, CancellationToken)

Waits for the next frame, so the code after the await runs on the game's thread.

public static Task WaitForGameThreadAsync(this IUtility utility, CancellationToken cancellationToken = default)

Parameters

utility IUtility
cancellationToken CancellationToken

Cancels the wait on the next frame. A new game or a save load also cancels it.

Returns

Task

A task that completes inside OnFrame on the next frame.

Remarks

A handler of an event raised on a worker thread awaits this before it calls a member documented as called on the game's thread.

WaitSeconds(IUtility, float, CancellationToken)

Waits for seconds of UnpausedTime.

public static Task WaitSeconds(this IUtility utility, float seconds, CancellationToken cancellationToken = default)

Parameters

utility IUtility
seconds float

The duration in seconds. Zero or less completes on the next frame.

cancellationToken CancellationToken

Cancels the wait on the next frame. A new game or a save load also cancels it.

Returns

Task

A task that completes on the first frame at least seconds later.