Class DocumentFragment
Inheritance
Namespace: Telerik.Windows.Documents.Model
Assembly: Telerik.Windows.Controls.RichTextBox.dll
Syntax
public class DocumentFragment : Object
Constructors
DocumentFragment(RadDocument)
Initializes a new instance of the DocumentFragment class.
Declaration
public DocumentFragment(RadDocument document)
Parameters
RadDocument
document
The document to be added to the fragment. |
DocumentFragment(DocumentSelection)
Initializes a new instance of the DocumentFragment class.
Declaration
public DocumentFragment(DocumentSelection documentSelection)
Parameters
DocumentSelection
documentSelection
The document selection to be added to the fragment. |
DocumentFragment(DocumentSelection, Boolean)
Initializes a new instance of the DocumentFragment class.
Declaration
public DocumentFragment(DocumentSelection documentSelection, bool includeNonCopyableAnnotationMarkers)
Parameters
DocumentSelection
documentSelection
selection |
System.Boolean
includeNonCopyableAnnotationMarkers
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. |
Properties
IsEmpty
Gets a value indicating whether the fragment is empty.
Declaration
public bool IsEmpty { get; }
Property Value
System.Boolean
|
IsLastParagraphClosed
Gets or sets a value indicating whether the fragment ends with full empty paragraph.
Declaration
public bool IsLastParagraphClosed { get; set; }
Property Value
System.Boolean
|
Methods
CreateFromInline(Inline)
Creates a fragment from Inline.
Declaration
public static DocumentFragment CreateFromInline(Inline inline)
Parameters
Inline
inline
The Inline to add to the fragment. |
Returns
DocumentFragment
|
EnumerateChildrenOfType<T>()
Enumerates all children of a specified type.
Declaration
public IEnumerable<T> EnumerateChildrenOfType<T>()
where T : DocumentElement
Returns
System.Collections.Generic.IEnumerable<T>
A collection from the children of the specified type. |
Type Parameters
T
A type deriving from DocumentElement which represents the type of the children that should be enumerated. |
GetText()
Converts the fragment to plain text.
Declaration
public string GetText()
Returns
System.String
String containing the text representation of the document. |
ToDocument()
Converts to this instance to a RadDocument.
Declaration
public RadDocument ToDocument()
Returns
RadDocument
The RadDocument generated from the current instance. |