Back to Devexpress

ParagraphPropertiesBase.Reset(ParagraphPropertiesMask) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-paragraphpropertiesbase-dot-reset-x28-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-paragraphpropertiesmask-x29.md

latest7.0 KB
Original Source

ParagraphPropertiesBase.Reset(ParagraphPropertiesMask) Method

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

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
void Reset(
    ParagraphPropertiesMask mask
)
vb
Sub Reset(
    mask As ParagraphPropertiesMask
)

Parameters

NameTypeDescription
maskParagraphPropertiesMask

A ParagraphPropertiesMask enumeration value.

|

Remarks

The Reset sets paragraph properties to the underlying style (or the default style, if the style is not applied). The mask allows you to specify paragraph properties to reset.

Example

The following code snippet modifies Alignment and FirstLineIndent properties. These properties are reset to Document.DefaultParagraphProperties values if no specific paragraph style is applied. Other paragraph properties remain unchanged.

View Example

csharp
using XtraRichEdit.API.Native;

using (var wordProcessor = new RichEditDocumentServer())
{
    wordProcessor.LoadDocument("Grimm.docx");
    Document document = wordProcessor.Document;
    DocumentRange range = document.Paragraphs[0].Range;

    // Set alignment and indentation of the first line
    // in the first paragraph to default.
    // Other paragraph properties remain intact.
    ParagraphProperties cp = document.BeginUpdateParagraphs(range);
    cp.Reset(ParagraphPropertiesMask.Alignment | ParagraphPropertiesMask.FirstLineIndent);
    document.EndUpdateParagraphs(cp);
}
vb
Imports XtraRichEdit.API.Native

Using wordProcessor = New RichEditDocumentServer()
    wordProcessor.LoadDocument("Grimm.docx")
    Dim document As Document = wordProcessor.Document
    Dim range As DocumentRange = document.Paragraphs(0).Range

    ' Set alignment and indentation of the first line
    ' in the first paragraph to default.
    ' Other paragraph properties remain intact.
    Dim cp As ParagraphProperties = document.BeginUpdateParagraphs(range)
    cp.Reset(ParagraphPropertiesMask.Alignment Or ParagraphPropertiesMask.FirstLineIndent)
    document.EndUpdateParagraphs(cp)
End Using

The following code snippets (auto-collected from DevExpress Examples) contain references to the Reset(ParagraphPropertiesMask) 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.

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Formatting.cs#L92

csharp
ParagraphProperties cp = document.BeginUpdateParagraphs(range);
cp.Reset(ParagraphPropertiesMask.Alignment | ParagraphPropertiesMask.FirstLineIndent);
document.EndUpdateParagraphs(cp);

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/FormattingActions.cs#L76

csharp
ParagraphProperties cp = document.BeginUpdateParagraphs(range);
cp.Reset(ParagraphPropertiesMask.Alignment | ParagraphPropertiesMask.FirstLineIndent);
document.EndUpdateParagraphs(cp);

word-document-api-examples/CS/CodeExamples/FormattingActions.cs#L215

csharp
// Other paragraph properties remain intact.
cp.Reset(ParagraphPropertiesMask.Alignment | ParagraphPropertiesMask.FirstLineIndent);

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Formatting.vb#L83

vb
Dim cp As DevExpress.XtraRichEdit.API.Native.ParagraphProperties = document.BeginUpdateParagraphs(range)
cp.Reset(DevExpress.XtraRichEdit.API.Native.ParagraphPropertiesMask.Alignment Or DevExpress.XtraRichEdit.API.Native.ParagraphPropertiesMask.FirstLineIndent)
document.EndUpdateParagraphs(cp)

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/FormattingActions.vb#L70

vb
Dim cp As ParagraphProperties = document.BeginUpdateParagraphs(range)
cp.Reset(ParagraphPropertiesMask.Alignment Or ParagraphPropertiesMask.FirstLineIndent)
document.EndUpdateParagraphs(cp)

word-document-api-examples/VB/CodeExamples/FormattingActions.vb#L139

vb
' Other paragraph properties remain intact.
cp.Reset(DevExpress.XtraRichEdit.API.Native.ParagraphPropertiesMask.Alignment Or DevExpress.XtraRichEdit.API.Native.ParagraphPropertiesMask.FirstLineIndent)
' Finalize to edit the paragraph.

See Also

ParagraphPropertiesBase Interface

ParagraphPropertiesBase Members

DevExpress.XtraRichEdit.API.Native Namespace