Class
LayoutElementCollection

Represents a collection of layout elements used in Telerik's document layout system.

Definition

Namespace:Telerik.Windows.Documents.Layout

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public class LayoutElementCollection : LayoutElementCollectionBase, ILinkedListCollection<LayoutElement>, ICollection<LayoutElement>, IEnumerable<LayoutElement>, ICollection<LayoutBox>, IEnumerable<LayoutBox>, IEnumerable

Inheritance: objectLayoutElementCollectionBaseLayoutElementCollection

Implements: ICollection<LayoutBox>ICollection<LayoutElement>IEnumerableIEnumerable<LayoutBox>IEnumerable<LayoutElement>ILinkedListCollection<LayoutElement>

Inherited Members LayoutElementCollectionBase.boxesCollectionLayoutElementCollectionBase.parentLayoutBoxLayoutElementCollectionBase.CheckForLeafLayoutBoxCollection()

Constructors

LayoutElementCollection(DocumentStructureCollection, LayoutElement)

Declaration

cs-api-definition
public LayoutElementCollection(DocumentStructureCollection boxesCollection, LayoutElement parentLayoutBox)

Parameters

boxesCollection

DocumentStructureCollection

parentLayoutBox

LayoutElement

Properties

Count

Gets the number of elements in the collection.

Declaration

cs-api-definition
public int Count { get; }

Property Value

int

The number of elements in the LayoutElementCollection.

Implements ICollection<LayoutBox>.Count

First

Retrieves the first element from the collection of layout elements.

Declaration

cs-api-definition
public LayoutBox First { get; }

Property Value

LayoutBox

HasChildren

Indicates whether the layout element has any child elements.

Declaration

cs-api-definition
public bool HasChildren { get; }

Property Value

bool

IsReadOnly

Gets a value indicating whether the collection is read-only.

Declaration

cs-api-definition
public bool IsReadOnly { get; }

Property Value

bool

Returns true if the collection is read-only; otherwise, false.

Implements ICollection<LayoutBox>.IsReadOnly

Last

Gets the last element in the layout element collection.

Declaration

cs-api-definition
public LayoutBox Last { get; }

Property Value

LayoutBox

Methods

Add(LayoutBox)

Adds a LayoutBox to the LayoutElementCollection.

Declaration

cs-api-definition
public void Add(LayoutBox item)

Parameters

item

LayoutBox

The LayoutBox to add to the collection.

Implements ICollection<LayoutBox>.Add(LayoutBox)

AddLeafChildBox(LayoutBox, LayoutBox)

Adds a leaf child box to the specified parent box in the layout element collection.

Declaration

cs-api-definition
public void AddLeafChildBox(LayoutBox currentLayoutBox, LayoutBox newLayoutBox)

Parameters

currentLayoutBox

LayoutBox

The parent layout box to which the child box will be added.

newLayoutBox

LayoutBox

The child layout box that will be added to the parent box.

Clear()

Removes all elements from the LayoutElementCollection.

Declaration

cs-api-definition
public void Clear()

Implements ICollection<LayoutBox>.Clear()

Remarks

This method clears the collection, effectively resetting it to an empty state.

Contains(LayoutBox)

Determines whether the specified layout box is contained within the collection.

Declaration

cs-api-definition
public bool Contains(LayoutBox item)

Parameters

item

LayoutBox

The layout box to locate in the collection.

Returns

bool

true if the collection contains the specified layout box; otherwise, false.

Implements ICollection<LayoutBox>.Contains(LayoutBox)

CopyTo(LayoutBox[], int)

Copies the elements of the current LayoutElementCollection to the specified array, starting at the specified index in the array.

Declaration

cs-api-definition
public void CopyTo(LayoutBox[] array, int arrayIndex)

Parameters

array

LayoutBox[]

The array that is the destination of the elements copied from the collection.

arrayIndex

int

The zero-based index in the array at which storing the copied elements begins.

Implements ICollection<LayoutBox>.CopyTo(LayoutBox[], int)

GetEnumerator()

Retrieves an enumerator that allows iteration through the collection of layout elements.

Declaration

cs-api-definition
public IEnumerator<LayoutBox> GetEnumerator()

Returns

IEnumerator<LayoutBox>

An enumerator for the LayoutBox that can be used to iterate through the collection.

Implements IEnumerable<LayoutBox>.GetEnumerator()

Remove(LayoutBox)

Removes a specified LayoutBox from the LayoutElementCollection.

Declaration

cs-api-definition
public bool Remove(LayoutBox item)

Parameters

item

LayoutBox

The LayoutBox to be removed from the collection.

Returns

bool

Returns true if the LayoutBox was successfully removed; otherwise, false.

Implements ICollection<LayoutBox>.Remove(LayoutBox)

RemoveLast()

Removes the last element from the collection of layout elements.

Declaration

cs-api-definition
public void RemoveLast()