Back to Devexpress

Fields.UpdateAllAsync(Boolean, CancellationToken) Method

blazor-devexpress-dot-blazor-dot-richedit-dot-fields-dot-updateallasync-x28-system-dot-boolean-system-dot-threading-dot-cancellationtoken-x29.md

latest2.5 KB
Original Source

Fields.UpdateAllAsync(Boolean, CancellationToken) Method

Updates every field in the current sub-document or in all sub-documents.

Namespace : DevExpress.Blazor.RichEdit

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

NuGet Package : DevExpress.Blazor.RichEdit

Declaration

csharp
public ValueTask UpdateAllAsync(
    bool doInAllSubDocuments = false,
    CancellationToken cancellationToken = default(CancellationToken)
)

Optional Parameters

NameTypeDefaultDescription
doInAllSubDocumentsBooleanFalse

true to update fields in all sub-documents; false to update fields in the current sub-document only.

| | cancellationToken | CancellationToken | null |

An object that propagates a cancellation notification.

|

Returns

TypeDescription
ValueTask

A structure that stores an awaitable result of an asynchronous operation.

|

Remarks

Update fields to calculate and display the field results.

The following example shows how you can update every field in all sub-documents:

razor
<DxRichEdit @ref="@richEdit" />

@code {
    DxRichEdit richEdit;
    Document documentAPI;
    @* ... *@
    /* Surround the code that contains an asynchronous operation with a try-catch block to handle
    the OperationCanceledException. This exception is thrown when an asynchronous operation is canceled. */
        try {
            documentAPI = richEdit.DocumentAPI;
            @* ... *@
            await documentAPI.Fields.UpdateAllAsync(true);
            @* ... *@
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}

The UpdateAsync(Field, CancellationToken) method allows you to update a field.

See Also

Fields Class

Fields Members

DevExpress.Blazor.RichEdit Namespace