Editor service
Control editing commands, clipboard operations, history, search, scrolling and printing through an awaited facade. The current view supplies its own history and selection.
The facade is available as editor.Editor; its interface can be replaced by an application implementation.

Use it in your application
Run commands on the UI thread after readiness. Read-only state, selection changes and document ownership are checked at application boundaries; handle rejected or cancelled operations in your host.
All examples assume an editor named editor, already attached to a visible window, and an awaited editor.Ready. Keep operations asynchronous instead of blocking the UI thread.
bool canUndo = await editor.StateQuery.CanUndoAsync();
if (canUndo) await editor.Editor.UndoAsync();Members
These signatures come from the delivered 1.0.2 assemblies and XML documentation. Cancellation tokens can be supplied to awaited operations. Follow the source-specific notes above when adapting a WPF integration.
| Member | Signature |
|---|---|
ClearUndoStackAsync | Task ClearUndoStackAsync(CancellationToken cancellationToken) |
CopyAsync | Task CopyAsync(CancellationToken cancellationToken) |
CutAsync | Task CutAsync(CancellationToken cancellationToken) |
DeleteAsync | Task DeleteAsync(CancellationToken cancellationToken) |
DeleteTextAsync | Task DeleteTextAsync(int startIndex, int length, CancellationToken cancellationToken) |
FocusAsync | Task<bool> FocusAsync(CancellationToken cancellationToken) |
GetScrollBarSettingAsync | Task<ScrollBarVisibility> GetScrollBarSettingAsync(CancellationToken cancellationToken) |
GetScrollPositionAsync | Task<Point> GetScrollPositionAsync(CancellationToken cancellationToken) |
GetScrollStateAsync | Task<EditorScrollState> GetScrollStateAsync(CancellationToken cancellationToken) |
JustifyCenterAsync | Task JustifyCenterAsync(CancellationToken cancellationToken) |
JustifyLeftAsync | Task JustifyLeftAsync(CancellationToken cancellationToken) |
JustifyRightAsync | Task JustifyRightAsync(CancellationToken cancellationToken) |
PasteAsync | Task PasteAsync(CancellationToken cancellationToken) |
PasteFromMsWordAsync | Task PasteFromMsWordAsync(CancellationToken cancellationToken) |
PrintAsync | Task PrintAsync(CancellationToken cancellationToken) |
RedoAsync | Task RedoAsync(CancellationToken cancellationToken) |
ReplaceAllAsync | Task<int> ReplaceAllAsync(string replaceWhat, string replaceWith, bool matchWholeWord, bool matchCase, CancellationToken cancellationToken) |
ReplaceAsync | Task<bool> ReplaceAsync(string searchString, string replacement, bool matchWholeWord, bool matchCase, CancellationToken cancellationToken) |
ReplaceTextAsync | Task ReplaceTextAsync(int startIndex, int length, string replacementText, CancellationToken cancellationToken) |
SearchAsync | Task<bool> SearchAsync(string text, bool forward, bool matchWholeWord, bool matchCase, CancellationToken cancellationToken) |
SetScrollBarSettingAsync | Task SetScrollBarSettingAsync(ScrollBarVisibility scrollbarValue, CancellationToken cancellationToken) |
SetScrollPositionAsync | Task SetScrollPositionAsync(int x, int y, CancellationToken cancellationToken) |
ShowPrintPreviewDialogAsync | Task ShowPrintPreviewDialogAsync(CancellationToken cancellationToken) |
ShowSearchDialogAsync | Task ShowSearchDialogAsync(CancellationToken cancellationToken) |
UnFocusAsync | Task UnFocusAsync(CancellationToken cancellationToken) |
UndoAsync | Task UndoAsync(CancellationToken cancellationToken) |