ClassStructureElementsCollection
Mutable list managing child StructureElement nodes of a structure tree, enforcing parent linkage on insert/remove.
Definition
Namespace:Telerik.Windows.Documents.Fixed.Model
Assembly:Telerik.Windows.Documents.Fixed.dll
Syntax:
public class StructureElementsCollection : IEnumerable
Inheritance: objectStructureElementsCollection
Implements:
Properties
Count
Gets the current number of structure elements held in the collection.
IsReadOnly
Gets a value indicating whether the collection is read‑only (always false for this implementation).
this[int]
Gets or sets the StructureElement at the given zero‑based index.
Declaration
public StructureElement this[int index] { get; set; }
Parameters
index
The index.
Property Value
The structure element at the specified index.
Methods
AddStructureElement(StructureTagType)
Creates, appends, and returns a new StructureElement using the specified standard structure tag.
Declaration
public StructureElement AddStructureElement(StructureTagType tag)
Parameters
tag
The tag to associate with the structure element.
Returns
The newly created StructureElement.
AddStructureElement(string, StructureTagType)
Creates, appends, and returns a new structure element with the provided custom tag mapped to the given standard type.
Declaration
public StructureElement AddStructureElement(string customTag, StructureTagType tag)
Parameters
customTag
The custom tag to assign to the new structure element.
tag
The standard structure tag type mapped to the custom tag.
Returns
The newly created StructureElement.
Clear()
Removes all elements, clearing parent references from each before disposal.
Declaration
public void Clear()
Contains(StructureElement)
Determines whether the specified element instance is contained in the collection.
Declaration
public bool Contains(StructureElement item)
Parameters
item
The structure element to locate in the collection.
Returns
true if the structure element is found; otherwise, false.
CopyTo(StructureElement[], int)
Copies all elements to the target array starting at the provided destination index.
Declaration
public void CopyTo(StructureElement[] array, int arrayIndex)
Parameters
array
The array to copy elements to.
arrayIndex
The zero-based index in the array at which copying begins.
GetEnumerator()
Returns an enumerator for iterating through the elements in order of insertion.
Declaration
public IEnumerator<StructureElement> GetEnumerator()
Returns
IEnumerator<StructureElement>
An enumerator for the collection.
IndexOf(StructureElement)
Gets the zero‑based index of the specified element instance, or -1 if not found.
Declaration
public int IndexOf(StructureElement item)
Parameters
item
The structure element to locate in the collection.
Returns
The index of the structure element if found; otherwise, -1.
Insert(int, StructureElement)
Inserts the provided element at the given index, updating its parent reference.
Declaration
public void Insert(int index, StructureElement item)
Parameters
index
The zero-based index at which the structure element should be inserted.
item
The structure element to insert.
Remove(StructureElement)
Removes the first matching element, nulling its parent reference if found.
Declaration
public bool Remove(StructureElement item)
Parameters
item
The structure element to remove.
Returns
true if the structure element was successfully removed; otherwise, false.
RemoveAt(int)
Removes the element at the specified index and clears its parent reference.
Declaration
public void RemoveAt(int index)
Parameters
index
The zero-based index of the structure element to remove.