Skip to main content

CharacterPropertiesBase.Reset(CharacterPropertiesMask) Method

Resets the character formatting properties specified by the mask to the properties of the underlying character style or to default properties.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v24.1.Core.dll

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

void Reset(
    CharacterPropertiesMask mask
)

Parameters

Name Type Description
mask CharacterPropertiesMask

A CharacterPropertiesMask enumeration value.

Remarks

The Reset method sets character properties to the Normal style. The mask allows you to specify character properties which will be reset.

The following code snippet modifies CharacterPropertiesBase.FontSize and CharacterPropertiesBase.FontName properties. These properties are reset to Document.DefaultCharacterProperties values if no specific character style is applied. Other character properties remain unchanged.

View Example

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer()) {
    Document document = wordProcessor.Document;
    document.LoadDocument("Grimm.docx", DocumentFormat.OpenXml);

    // Set font size and font name of the characters in the first paragraph to default. 
    // Other character properties remain intact.
    DocumentRange range = document.Paragraphs[0].Range;
    CharacterProperties cp = document.BeginUpdateCharacters(range);
    cp.Reset(CharacterPropertiesMask.FontSize | CharacterPropertiesMask.FontName);
    document.EndUpdateCharacters(cp);
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the Reset(CharacterPropertiesMask) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also