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
optionsPrismOptions
Properties
IsAutoPowerManagementSupported
Whether AutoPowerManagement works on this system.
public static bool IsAutoPowerManagementSupported { get; }
Property Value
Version
The version of prism Refractor is running, as major, minor and patch.
public static Version Version { get; }
Property Value
VersionString
The full version prism was built as, which can carry more than Version.
public static string VersionString { get; }
Property Value
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
idBackendId
Returns
AcquireBest()
The shared counterpart of CreateBest(). Always initialized.
public Backend AcquireBest()
Returns
Create(BackendId)
A new instance with its own state. Call Initialize() before using it.
public Backend Create(BackendId id)
Parameters
idBackendId
Returns
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
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
namestring
Returns
GetBackendIds()
Every registered backend, highest priority first. Registered is not the same as usable.
public IReadOnlyList<BackendId> GetBackendIds()
Returns
GetBackendName(BackendId)
The name of a registered backend, or null when the id is not registered.
public string? GetBackendName(BackendId id)
Parameters
idBackendId
Returns
GetBackendPriority(BackendId)
Higher runs first in CreateBest(). Null when the id is not registered.
public int? GetBackendPriority(BackendId id)
Parameters
idBackendId
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
idBackendId
Returns
GetErrorMessage(PrismError)
prism's description of an error, such as "Backend not available".
public static string GetErrorMessage(PrismError error)
Parameters
errorPrismError
Returns
HasBackend(BackendId)
Whether the backend is registered. It says nothing about whether it will start.
public bool HasBackend(BackendId id)
Parameters
idBackendId
Returns
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)