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