Class LayoutElementCollection
Represents a collection of layout elements used in Telerik's document layout system.
Inherited Members
Namespace: Telerik.Windows.Documents.Layout
Assembly: Telerik.Windows.Controls.RichTextBox.dll
Syntax
public class LayoutElementCollection : LayoutElementCollectionBase, ILinkedListCollection<LayoutElement>, ICollection<LayoutElement>, IEnumerable<LayoutElement>, ICollection<LayoutBox>, IEnumerable<LayoutBox>, IEnumerable
Constructors
LayoutElementCollection(DocumentStructureCollection, LayoutElement)
Declaration
public LayoutElementCollection(DocumentStructureCollection boxesCollection, LayoutElement parentLayoutBox)
Parameters
DocumentStructureCollection
boxesCollection
|
LayoutElement
parentLayoutBox
|
Properties
Count
Gets the number of elements in the collection.
Declaration
public int Count { get; }
Property Value
System.Int32
The number of elements in the LayoutElementCollection. |
First
Retrieves the first element from the collection of layout elements.
Declaration
public LayoutBox First { get; }
Property Value
LayoutBox
|
HasChildren
Indicates whether the layout element has any child elements.
Declaration
public bool HasChildren { get; }
Property Value
System.Boolean
|
IsReadOnly
Gets a value indicating whether the collection is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
System.Boolean
Returns true if the collection is read-only; otherwise, false. |
Last
Gets the last element in the layout element collection.
Declaration
public LayoutBox Last { get; }
Property Value
LayoutBox
|
Methods
Add(LayoutBox)
Adds a LayoutBox to the LayoutElementCollection.
Declaration
public void Add(LayoutBox item)
Parameters
LayoutBox
item
The LayoutBox to add to the collection. |
AddLeafChildBox(LayoutBox, LayoutBox)
Adds a leaf child box to the specified parent box in the layout element collection.
Declaration
public void AddLeafChildBox(LayoutBox currentLayoutBox, LayoutBox newLayoutBox)
Parameters
LayoutBox
currentLayoutBox
The parent layout box to which the child box will be added. |
LayoutBox
newLayoutBox
The child layout box that will be added to the parent box. |
Clear()
Removes all elements from the LayoutElementCollection.
Declaration
public void 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
public bool Contains(LayoutBox item)
Parameters
LayoutBox
item
The layout box to locate in the collection. |
Returns
System.Boolean
true if the collection contains the specified layout box; otherwise, false. |
CopyTo(LayoutBox[], Int32)
Copies the elements of the current LayoutElementCollection to the specified array, starting at the specified index in the array.
Declaration
public void CopyTo(LayoutBox[] array, int arrayIndex)
Parameters
LayoutBox[]
array
The array that is the destination of the elements copied from the collection. |
System.Int32
arrayIndex
The zero-based index in the array at which storing the copied elements begins. |
GetEnumerator()
Retrieves an enumerator that allows iteration through the collection of layout elements.
Declaration
public IEnumerator<LayoutBox> GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<LayoutBox>
An enumerator for the LayoutBox that can be used to iterate through the collection. |
Remove(LayoutBox)
Removes a specified LayoutBox from the LayoutElementCollection.
Declaration
public bool Remove(LayoutBox item)
Parameters
LayoutBox
item
The LayoutBox to be removed from the collection. |
Returns
System.Boolean
Returns true if the LayoutBox was successfully removed; otherwise, false. |
RemoveLast()
Removes the last element from the collection of layout elements.
Declaration
public void RemoveLast()