New to Telerik UI for WinFormsStart a free 30-day trial

Definition

Namespace:Telerik.WinForms.Documents.Model

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class DocumentFragment

Inheritance: objectDocumentFragment

Constructors

Initializes a new instance of the DocumentFragment class.

C#
public DocumentFragment(DocumentSelection documentSelection, bool includeNonCopyableAnnotationMarkers)
Parameters:documentSelectionDocumentSelection

selection

includeNonCopyableAnnotationMarkersbool

If true result fragment will contain non-copyable elements like read-only and permission ranges. Otherwise these elements will be removed from the result fragment.

Initializes a new instance of the DocumentFragment class.

C#
public DocumentFragment(DocumentSelection documentSelection)
Parameters:documentSelectionDocumentSelection

The document selection to be added to the fragment.

Initializes a new instance of the DocumentFragment class.

C#
public DocumentFragment(RadDocument document)
Parameters:documentRadDocument

The document to be added to the fragment.

Properties

Gets a value indicating whether the fragment is empty.

C#
public bool IsEmpty { get; }
Property Value:

true if the fragment is empty; otherwise, false.

Gets or sets a value indicating whether the fragment ends with full empty paragraph.

C#
public bool IsLastParagraphClosed { get; set; }
Property Value:

true if the fragment ends with full empty paragraph; otherwise, false.

Methods

Creates a fragment from Inline.

C#
public static DocumentFragment CreateFromInline(Inline inline)
Parameters:inlineInline

The Inline to add to the fragment.

Returns:

DocumentFragment

Enumerates all children of a specified type.

C#
public IEnumerable<T> EnumerateChildrenOfType<T>() where T : DocumentElement
Returns:

IEnumerable<T>

A collection from the children of the specified type.

Converts the fragment to plain text.

C#
public string GetText()
Returns:

string

String containing the text representation of the document.

Converts to this instance to a RadDocument.

C#
public RadDocument ToDocument()
Returns:

RadDocument

The RadDocument generated from the current instance.