Class RichEditorSession
- Namespace
- RichEdit.Core
- Assembly
- RichEdit.Core.dll
An independent typed selection and edit origin over a shared rich document.
public sealed class RichEditorSession : IDisposable
- Inheritance
-
RichEditorSession
- Implements
- Inherited Members
Properties
Composition
Gets this view's provisional composition, or null outside marked input.
public RichComposition? Composition { get; }
Property Value
Document
Gets the shared rich document.
public RichDocument Document { get; }
Property Value
IsReadOnly
Gets or sets whether this view accepts authored edits.
public bool IsReadOnly { get; set; }
Property Value
RevisionTracking
Gets or sets the authorship and group for this view's edits, including committed IME input. Null disables tracking.
public RichRevisionInfo? RevisionTracking { get; set; }
Property Value
Selection
Gets or sets the typed selection. Cell rectangles expand to whole merged cells.
public RichSelection Selection { get; set; }
Property Value
SelectionGeneration
Gets the generation of this session's selection.
public long SelectionGeneration { get; }
Property Value
TypingCharacterFormat
Gets or sets view-owned character overrides for newly typed text. Moving the selection clears these overrides.
public RichCharacterStyle TypingCharacterFormat { get; set; }
Property Value
Methods
ApplyCharacterFormat(RichCharacterStyle)
Applies character overrides to selected content, or to view-owned typing state at collapsed carets.
public RichEditResult ApplyCharacterFormat(RichCharacterStyle format)
Parameters
formatRichCharacterStyle
Returns
BeginComposition()
Acquires the document's composition lease while keeping committed content and history unchanged.
public RichComposition BeginComposition()
Returns
Dispose()
Detaches this session without clearing document history.
public void Dispose()
Edit(Action<RichDocumentEdit>, RichEditOptions, DocumentRevision?, long?)
Commits a checked view-originating transaction.
public RichEditResult Edit(Action<RichDocumentEdit> edit, RichEditOptions options = default, DocumentRevision? expectedRevision = null, long? expectedSelectionGeneration = null)
Parameters
editAction<RichDocumentEdit>optionsRichEditOptionsexpectedRevisionDocumentRevision?expectedSelectionGenerationlong?
Returns
Redo()
Redoes one global document unit and restores its recorded selection in this invoking view.
public void Redo()
ReplaceSelection(RichDocumentFragment, RichEditOptions)
Pastes a rich fragment at the current typed selection or every text caret in one transaction.
public RichEditResult ReplaceSelection(RichDocumentFragment fragment, RichEditOptions options = default)
Parameters
fragmentRichDocumentFragmentoptionsRichEditOptions
Returns
ReplaceSelection(string, RichEditOptions)
Replaces the current typed selection or every rich text caret in one transaction.
public RichEditResult ReplaceSelection(string text, RichEditOptions options = default)
Parameters
textstringoptionsRichEditOptions
Returns
ResolveTypingCharacterFormat()
Resolves the current caret's authored cascade and view-owned typing overrides.
public ResolvedCharacterStyle ResolveTypingCharacterFormat()
Returns
SelectAll()
Selects every authored body block, including complete tables and lists.
public void SelectAll()
ToggleBold()
Toggles bold according to the resolved values across the typed selection.
public RichEditResult ToggleBold()
Returns
ToggleItalic()
Toggles italic according to the resolved values across the typed selection.
public RichEditResult ToggleItalic()
Returns
ToggleUnderline()
Toggles single underlining according to the resolved values across the typed selection.
public RichEditResult ToggleUnderline()
Returns
Undo()
Undoes one global document unit and restores its recorded selection in this invoking view.
public void Undo()
Events
Changed
Occurs after authored content and every attached view's selection have synchronized.
public event EventHandler<RichDocumentChangedEventArgs>? Changed
Event Type
CompositionChanged
Occurs when provisional marked input starts, changes, commits, or cancels.
public event EventHandler? CompositionChanged
Event Type
ReadOnlyChanged
Occurs when this view's editability changes.
public event EventHandler? ReadOnlyChanged
Event Type
SelectionChanged
Occurs after this session's selection changes.
public event EventHandler? SelectionChanged
Event Type
TypingFormatChanged
Occurs when view-owned typing overrides are explicitly changed.
public event EventHandler? TypingFormatChanged