Class RecordingSession
Attaches to a running process and records UIA events until Stop() is called. Thread-safe: event handlers fire on the UIA COM background thread; all state is protected by ConcurrentQueue<T> and Interlocked.
public sealed class RecordingSession : IDisposable
- Inheritance
-
RecordingSession
- Implements
- Inherited Members
Properties
Events
Live snapshot of events captured so far (thread-safe).
public IReadOnlyList<RecordedEvent> Events { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
FromProcessId(int)
Creates a session attached to an already-running process by PID.
public static RecordingSession FromProcessId(int processId)
Parameters
processIdint
Returns
FromProcessName(string)
Creates a session attached to the first running process matching processName.
public static RecordingSession FromProcessName(string processName)
Parameters
processNamestring
Returns
Start()
Attaches Windows UI Automation to the target process and registers UIA event handlers. Must be called before events will be captured.
public void Start()
Stop()
Unregisters all UIA event handlers and returns the captured events.
public IReadOnlyList<RecordedEvent> Stop()
Returns
Events
EventCaptured
Raised on the UIA background thread for each captured event.
public event Action<RecordedEvent>? EventCaptured