Skip to main content

PasteUnformattedAction Class

Definition

Assembly:Avalonia.Controls.RichTextEditor
Package:Avalonia.Controls.RichTextEditor

Action that pastes the clipboard content as plain text, dropping all formatting, inline wrappers, lists, tables, and metadata.

public class PasteUnformattedAction

Inheritance: object -> EditorAction -> PasteUnformattedAction

Remarks

Probes the clipboard via Avalonia.Controls.Documents.Primitives.Components.ClipboardOperations.TryGetPlainTextSnapshotAsync(Avalonia.Input.Platform.IClipboard,System.Threading.CancellationToken): when an in-process snapshot is present it is lowered through PlainTextSerializer (Serialize → Deserialize) so the source text is preserved exactly as our serializer emits it; otherwise the platform DataFormat.Text payload is parsed straight into a snapshot. The resulting snapshot is grafted via TextRange.InsertSnapshot the same way Avalonia.Controls.Documents.Primitives.Actions.PasteAction inserts rich content.

Constructors

NameDescription
PasteUnformattedActionNo summary available.

PasteUnformattedAction Constructor

public PasteUnformattedAction()

Methods

NameDescription
CanExecuteNo summary available.
ExecuteNo summary available.
ExecuteAsyncNo summary available.
GetStateGets the current state of the action. Inherited from EditorAction.

CanExecute Method

public bool CanExecute(Avalonia.Controls.Documents.Primitives.ITextEditorHost host)

Parameters

host Avalonia.Controls.Documents.Primitives.ITextEditorHost

Returns

bool

Execute Method

public void Execute(Avalonia.Controls.Documents.Primitives.ITextEditorHost host)

Parameters

host Avalonia.Controls.Documents.Primitives.ITextEditorHost

ExecuteAsync Method

public System.Threading.Tasks.Task ExecuteAsync(Avalonia.Controls.Documents.Primitives.ITextEditorHost host)

Parameters

host Avalonia.Controls.Documents.Primitives.ITextEditorHost

Returns

System.Threading.Tasks.Task

Properties

NameDescription
DisplayNameNo summary available.
GestureNo summary available.
IdNo summary available.

DisplayName Property

public string DisplayName { get; set; }

Gesture Property

public Avalonia.Input.KeyGesture Gesture { get; set; }

Id Property

public string Id { get; set; }