Represents a collection of document structure elements for managing and manipulating document layouts.
Definition
Namespace:Telerik.Windows.Documents.DocumentStructure
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public class DocumentStructureCollection
Inheritance: objectDocumentStructureCollection
Constructors
public DocumentStructureCollection(LayoutElement layoutElement)
Properties
Represents a stack used for enumerating the document structure collection.
public BoxParentsStack EnumerationStack { get; }
Methods
Adds a container child before a specified layout box in the document structure collection.
Adds a new container sibling after the specified layout box in the document structure collection.
Adds a container sibling before the specified layout box in the document structure collection.
Adds a leaf child box to the specified parent box within the document structure collection.
Adds a leaf sibling after the specified layout box in the document structure collection.
Adds a leaf sibling element before the specified layout box in the document structure collection.
Adds a sibling layout box after the specified layout box in the document structure collection.
Clears the children of the specified layout box from the document structure collection.
public void ClearChildren(LayoutBox layoutBoxParent)
The layout box whose children will be cleared from the collection.
Retrieves the first child DocumentStructureCollection of the specified LayoutBox.
Retrieves the last child element of the specified layout box in the document structure collection.
Retrieves the next associated layout box for the specified layout box and document element.
public static LayoutBox GetNextAssociatedLayoutBox(LayoutBox box, DocumentElement associatedDocumentElement)
The layout box for which to find the next associated layout box.
associatedDocumentElementDocumentElementThe document element that is associated with the layout box.
Returns:The next associated layout box, or null if no associated layout box is found.
Retrieves the next element of the same type as the specified layout box within the document structure collection.
Retrieves the next element of the specified type from the document structure collection, starting from the given layout box.
public static LayoutBox GetNextElementOfType(LayoutBox box, Type type)
The starting layout box from which to search for the next element.
typeTypeThe type of the element to find within the document structure collection.
Returns:The next element of the specified type if found; otherwise, null.
Retrieves the next sibling element in the document structure for the specified layout box.
Retrieves the next sibling element for a specified document element within a layout box.
public static LayoutBox GetNextSiblingForDocumentElement(LayoutBox box, DocumentElement owner)
The layout box in which the document element is located.
ownerDocumentElementThe document element for which to find the next sibling.
Returns:The next sibling document element if it exists; otherwise, null.
Retrieves the next sibling document element that is on the same level in the document structure as the specified document element.
public static LayoutBox GetNextSiblingForDocumentElementOnSameLevel(LayoutBox box, DocumentElement owner)
The layout box in which the document element resides.
ownerDocumentElementThe document element for which the next sibling is to be found.
Returns:The next sibling document element on the same level, or null if there is no such sibling.
Retrieves the parent element of the specified layout box within the document structure collection.
Retrieves the previous element of the same type as the specified layout box within the document structure collection.
Retrieves the previous element of the specified type from a given layout box.
Retrieves the previous sibling of the specified layout box within the document structure collection.
Retrieves the previous sibling of the specified document element within the document structure collection.
public static LayoutBox GetPreviousSiblingForDocumentElement(LayoutBox box, DocumentElement owner)
The layout box associated with the document element.
ownerDocumentElementThe document element for which the previous sibling is to be retrieved.
Returns:Returns the previous sibling document element if it exists; otherwise, returns null.
Retrieves the previous sibling of the specified document element at the same level in the document structure.
public static LayoutBox GetPreviousSiblingForDocumentElementOnSamelevel(LayoutBox box, DocumentElement owner)
The layout box associated with the document element.
ownerDocumentElementThe document element for which to find the previous sibling.
Returns:The previous sibling document element at the same level if found; otherwise, null.
Retrieves the root box of the document structure collection.
Merges the container elements within the document structure collection.
public void MergeContainers()
Merges the specified layout box into the document structure collection.
public void MergeContainers(LayoutBox fromBox)
The layout box to be merged into the document structure collection.
Merges long words in the specified paragraph layout box within the document structure collection.
public void MergeLongWords(ParagraphLayoutBox paragraphLayoutBox)
The paragraph layout box that contains the long words to be merged.
Merges long words from the specified layout box into the provided document element.
public void MergeLongWordsFromBox(InlineLayoutBox layoutBox, DocumentElement associatedDocumentElement)
The inline layout box containing the words to be merged.
associatedDocumentElementDocumentElementThe document element where the merged words will be incorporated.
Merges two table row layout boxes into a single row layout box.
public void MergeTableRowBoxes(TableRowLayoutBox firstRow, TableRowLayoutBox secondRow)
The first table row layout box to merge.
secondRowTableRowLayoutBoxThe second table row layout box to merge.
Merges two layout boxes into a single layout box.
public void MergeTwoLayoutBoxes(LayoutBox firstBox, LayoutBox secondBox, bool shouldFinalizeRemoval = true)
The first layout box to be merged.
secondBoxLayoutBoxThe second layout box to be merged.
shouldFinalizeRemovalboolIndicates whether to adjust the layout after merging.
Removes the last child element from the DocumentStructureCollection.
public void RemoveLastChild(LayoutBox parent)
The LayoutBox to be removed from the collection.
Removes the leaf sibling that appears after the specified layout box in the document structure collection.
public void RemoveLeafSiblingAfter(LayoutBox layoutBox)
The layout box after which the leaf sibling will be removed.
Replaces an existing layout box in the document structure collection with a new span layout box.
public static void ReplaceLayoutBox(LayoutBox boxWithNodeToUpdate, SpanLayoutBox newNodeValue)
The layout box that will be replaced.
newNodeValueSpanLayoutBoxThe span layout box that will replace the old layout box.
Splits a container into multiple layout boxes based on the specified layout boxes.
public void SplitContainer(LayoutBox boxToSplit, LayoutBox fromLayoutBox, LayoutBox newLayoutBox)
The layout box to be split.
fromLayoutBoxLayoutBoxThe layout box that will represent the first part after the split.
newLayoutBoxLayoutBoxThe layout box that will represent the second part after the split.
Returns a string representation of the DocumentStructureCollection instance.
public override string ToString()
A string that represents the current DocumentStructureCollection object.
Overrides: