Skip to main content

ContentRemovedEventArgs.RemovedText Property

Gets the textual representation of the removed content.

Namespace: DevExpress.Blazor.RichEdit

Assembly: DevExpress.Blazor.RichEdit.v23.2.dll

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public string RemovedText { get; }

Property Value

Type Description
String

The text.

Remarks

The RemovedText event argument allows you to get the removed content converted to plain text. This property returns an image or text box as the object replacement character () and returns a field in its full notation (for instance, "{DATE}26/10/2022>").

The example below demonstrates how you can log changes:

<DxRichEdit ContentInserted="OnContentInserted" ContentRemoved="OnContentRemoved"/>

@code {
    string filePath;

    protected override async Task OnInitializedAsync() {
        await base.OnInitializedAsync();
        filePath = @"C:\ChangeLogs\" + DateTime.Now.ToString("yyyy-M-d") + ".txt";
        using (FileStream fs = File.Create(filePath));
    }

    async void OnContentInserted(ContentChangedEventArgs args) {
        TextSpan textSpan = await args.SubDocument.GetTextSpanAsync(args.Interval);
        File.AppendAllText(filePath,
            "'" + textSpan.Text + "': was inserted to " + args.SubDocument.Type.ToString() +'\n');
    }

    async void OnContentRemoved(ContentRemovedEventArgs args) {
        File.AppendAllText(filePath,
            "'" + args.RemovedText + "': was removed from " + args.SubDocument.Type.ToString() +'\n');
    }
}
See Also