Class StudioRecorderService
Wraps RecordingSession (desktop) and WebRecorderClient (web)
and exposes recording state for the Blazor Studio.
Registered as Scoped — one instance per Blazor circuit (one per browser tab).
Thread-safe: UIA events fire on COM background threads; all state writes are guarded by
Interlocked / volatile / Lock.
public sealed class StudioRecorderService : IStudioRecorderService, IDisposable
- Inheritance
-
StudioRecorderService
- Implements
- Inherited Members
Constructors
StudioRecorderService(RuntimeOrchestrator)
public StudioRecorderService(RuntimeOrchestrator orchestrator)
Parameters
orchestratorRuntimeOrchestrator
Properties
CapturedEventCount
Number of events captured in the active session so far.
public int CapturedEventCount { get; }
Property Value
CurrentEvents
The raw events captured so far in the active session. Empty when not recording. Thread-safe snapshot on each access.
public IReadOnlyList<RecordedEvent> CurrentEvents { get; }
Property Value
CurrentInferredSteps
Live inference applied to CurrentEvents. Recomputed on each StateChanged tick (~250 ms debounce). Empty when not recording.
public IReadOnlyList<InferredStep> CurrentInferredSteps { get; }
Property Value
CurrentTarget
The target that is currently being (or was last) recorded.
public RecordingTargetInfo? CurrentTarget { get; }
Property Value
Elapsed
Elapsed time since recording started.
public TimeSpan Elapsed { get; }
Property Value
IsRecording
True while a recording session is active.
public bool IsRecording { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
ListAvailableTargetsAsync()
Returns running processes that have a visible main window and can be attached to. Silently skips elevated/protected processes.
public Task<IReadOnlyList<RecordingTargetInfo>> ListAvailableTargetsAsync()
Returns
ReplayRecordedFlowAsync(string, string)
Loads the flow at flowFilePath and executes it in-process using the
project rooted at projectPath. Returns pass/fail + step summary.
Never spawns an external process.
public Task<RecordingReplayResult> ReplayRecordedFlowAsync(string flowFilePath, string projectPath)
Parameters
Returns
StartRecordingAsync(int)
Attaches to processId and starts capturing events.
public Task StartRecordingAsync(int processId)
Parameters
processIdint
Returns
StartWebRecordingAsync(string, string, CancellationToken)
Spawns the Node.js web recorder, opens a browser at url,
and starts streaming web events.
public Task StartWebRecordingAsync(string url, string browserType, CancellationToken ct = default)
Parameters
urlstringInitial URL to navigate to (must be a valid absolute URL).
browserTypestringBrowser to launch: "chromium", "firefox", or "webkit".
ctCancellationTokenOptional cancellation token.
Returns
StopRecordingAsync()
Stops the active session and returns the inferred steps plus raw events.
public Task<RecordingResult> StopRecordingAsync()
Returns
Events
StateChanged
Fires when recording state changes (start/stop/new event). Debounced to ~250 ms so rapid UIA event streams don't spam Blazor renders.
public event Action? StateChanged