Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ContentRemovedEventArgs Class

Contains data for the ContentRemoved event.

Namespace: DevExpress.Blazor.RichEdit

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

NuGet Package: DevExpress.Blazor.RichEdit

#Declaration

C#
public class ContentRemovedEventArgs :
    ContentChangedEventArgs

#Remarks

The following code snippet demonstrates how you can log changes:

Razor
<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');
    }
}

#Inheritance

See Also