Table of Contents

Class Prism

Namespace
Refractor
Assembly
Refractor.dll

A prism context: the entry point for finding and creating backends. Registry calls are thread safe. Backends it hands out stay usable after it is disposed.

public sealed class Prism : IDisposable
Inheritance
Prism
Implements
Inherited Members

Constructors

Prism(PrismOptions?)

Creates a context, with prism's built-in backends unless options binds a Registry.

public Prism(PrismOptions? options = null)

Parameters

options PrismOptions

Properties

IsAutoPowerManagementSupported

Whether AutoPowerManagement works on this system.

public static bool IsAutoPowerManagementSupported { get; }

Property Value

bool

Version

The version of prism Refractor is running, as major, minor and patch.

public static Version Version { get; }

Property Value

Version

VersionString

The full version prism was built as, which can carry more than Version.

public static string VersionString { get; }

Property Value

string

Methods

Acquire(BackendId)

A shared instance, reused while any handle to it is alive, so voice and rate changes are seen by every holder. Call Initialize(); it may already be initialized.

public Backend Acquire(BackendId id)

Parameters

id BackendId

Returns

Backend

AcquireBest()

The shared counterpart of CreateBest(). Always initialized.

public Backend AcquireBest()

Returns

Backend

Create(BackendId)

A new instance with its own state. Call Initialize() before using it.

public Backend Create(BackendId id)

Parameters

id BackendId

Returns

Backend

CreateBest()

A new, initialized instance of the highest priority backend that starts. A running screen reader wins over standalone speech. This is the usual way in.

public Backend CreateBest()

Returns

Backend

Dispose()

Shuts the context down, waiting for availability polling to stop. Backends it handed out keep working.

public void Dispose()

FindBackend(string)

Finds a backend by its exact, case sensitive name, such as "NVDA".

public BackendId? FindBackend(string name)

Parameters

name string

Returns

BackendId?

GetBackendIds()

Every registered backend, highest priority first. Registered is not the same as usable.

public IReadOnlyList<BackendId> GetBackendIds()

Returns

IReadOnlyList<BackendId>

GetBackendName(BackendId)

The name of a registered backend, or null when the id is not registered.

public string? GetBackendName(BackendId id)

Parameters

id BackendId

Returns

string

GetBackendPriority(BackendId)

Higher runs first in CreateBest(). Null when the id is not registered.

public int? GetBackendPriority(BackendId id)

Parameters

id BackendId

Returns

int?

GetCachedBackend(BackendId)

Another handle to a shared instance from Acquire(BackendId), or null when none is alive.

public Backend? GetCachedBackend(BackendId id)

Parameters

id BackendId

Returns

Backend

GetErrorMessage(PrismError)

prism's description of an error, such as "Backend not available".

public static string GetErrorMessage(PrismError error)

Parameters

error PrismError

Returns

string

HasBackend(BackendId)

Whether the backend is registered. It says nothing about whether it will start.

public bool HasBackend(BackendId id)

Parameters

id BackendId

Returns

bool

PauseAvailabilityPolling()

Stops availability polling until ResumeAvailabilityPolling().

public void PauseAvailabilityPolling()

ResumeAvailabilityPolling()

Resumes polling with an immediate scan that reports every net change since the pause.

public void ResumeAvailabilityPolling()

TryFindBackend(string, out BackendId)

FindBackend(string) in the try pattern, which F# reads as a tuple to match on, as in match prism.TryFindBackend "NVDA" with | true, id -> ....

public bool TryFindBackend(string name, out BackendId id)

Parameters

name string
id BackendId

Returns

bool