New to Telerik UI for WinForms? Start a free 30-day trial

Provides access to a layout box's children while keeping the document structure collection in sync.

Definition

Namespace:Telerik.WinForms.Documents.Layout

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class LayoutElementCollection : LayoutElementCollectionBase, ILinkedListCollection<LayoutElement>, IEnumerable

Inheritance: objectLayoutElementCollectionBaseLayoutElementCollection

Implements: IEnumerableILinkedListCollection<LayoutElement>

Inherited Members LayoutElementCollectionBase.boxesCollectionLayoutElementCollectionBase.parentLayoutBoxLayoutElementCollectionBase.CheckForLeafLayoutBoxCollection()

Constructors

Initializes a collection for the children of the specified layout element.

C#
public LayoutElementCollection(DocumentStructureCollection boxesCollection, LayoutElement parentLayoutBox)
Parameters:boxesCollectionDocumentStructureCollection

The document structure collection that stores the boxes.

parentLayoutBoxLayoutElement

The layout box whose children are exposed.

Properties

Gets the number of child boxes in the document structure.

C#
public int Count { get; }

Gets the first child box.

C#
public LayoutBox First { get; }
Exceptions: InvalidOperationException

This collection has no parent box.

Gets whether this parent has any child boxes.

C#
public bool HasChildren { get; }

Gets whether this collection is read-only.

C#
public bool IsReadOnly { get; }

Gets the last child box.

C#
public LayoutBox Last { get; }
Exceptions: InvalidOperationException

This collection has no parent box.

Methods

Adds a box to this parent's child list in the document structure.

C#
public void Add(LayoutBox item)
Parameters:itemLayoutBox

The child box to add.

Inserts a leaf box immediately after the specified box in the document structure.

C#
public void AddLeafChildBox(LayoutBox currentLayoutBox, LayoutBox newLayoutBox)
Parameters:currentLayoutBoxLayoutBox

The existing box after which the new box is inserted.

newLayoutBoxLayoutBox

The leaf box to insert.

Does not clear the collection; clearing layout-box children is unsupported.

C#
public void Clear()
Exceptions: InvalidOperationException

Clearing layout-box children is not supported.

Checks whether the collection contains the specified box. This operation is not implemented.

C#
public bool Contains(LayoutBox item)
Parameters:itemLayoutBox

The box to locate.

Returns:

bool

Exceptions: NotImplementedException

The collection does not implement containment checks.

Copies the collection's boxes to an array. This operation is not implemented.

C#
public void CopyTo(LayoutBox[] array, int arrayIndex)
Parameters:arrayLayoutBox[]

The destination array.

arrayIndexint

The zero-based destination index at which copying begins.

Exceptions: NotImplementedException

Copying the collection to an array is not implemented.

Enumerates the boxes in this parent's child range in document-structure order.

C#
public IEnumerator<LayoutBox> GetEnumerator()
Returns:

IEnumerator<LayoutBox>

An enumerator over the child boxes.

Removes the specified box from the document structure.

C#
public bool Remove(LayoutBox item)
Parameters:itemLayoutBox

The box to remove.

Returns:

bool

true after requesting removal; membership is not checked first.

Removes the last child entry from the document structure. If it is a container, this operation is safe only when the child has no descendants.

C#
public void RemoveLast()
Exceptions: InvalidOperationException

This collection has no parent box.