Class
StructureElementsCollection

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:

cs-api-definition
public class StructureElementsCollection : IList<StructureElement>, ICollection<StructureElement>, IEnumerable<StructureElement>, IEnumerable

Inheritance: objectStructureElementsCollection

Implements: ICollection<StructureElement>IEnumerableIEnumerable<StructureElement>IList<StructureElement>

Properties

Count

Gets the current number of structure elements held in the collection.

Declaration

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

Property Value

int

Implements ICollection<StructureElement>.Count

IsReadOnly

Gets a value indicating whether the collection is read‑only (always false for this implementation).

Declaration

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

Property Value

bool

Implements ICollection<StructureElement>.IsReadOnly

this[int]

Gets or sets the StructureElement at the given zero‑based index.

Declaration

cs-api-definition
public StructureElement this[int index] { get; set; }

Parameters

index

int

The index.

Property Value

StructureElement

The structure element at the specified index.

Implements IList<StructureElement>.this[int]

Methods

AddStructureElement(StructureTagType)

Creates, appends, and returns a new StructureElement using the specified standard structure tag.

Declaration

cs-api-definition
public StructureElement AddStructureElement(StructureTagType tag)

Parameters

tag

StructureTagType

The tag to associate with the structure element.

Returns

StructureElement

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

cs-api-definition
public StructureElement AddStructureElement(string customTag, StructureTagType tag)

Parameters

customTag

string

The custom tag to assign to the new structure element.

tag

StructureTagType

The standard structure tag type mapped to the custom tag.

Returns

StructureElement

The newly created StructureElement.

Clear()

Removes all elements, clearing parent references from each before disposal.

Declaration

cs-api-definition
public void Clear()

Implements ICollection<StructureElement>.Clear()

Contains(StructureElement)

Determines whether the specified element instance is contained in the collection.

Declaration

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

Parameters

item

StructureElement

The structure element to locate in the collection.

Returns

bool

true if the structure element is found; otherwise, false.

Implements ICollection<StructureElement>.Contains(StructureElement)

CopyTo(StructureElement[], int)

Copies all elements to the target array starting at the provided destination index.

Declaration

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

Parameters

array

StructureElement[]

The array to copy elements to.

arrayIndex

int

The zero-based index in the array at which copying begins.

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

GetEnumerator()

Returns an enumerator for iterating through the elements in order of insertion.

Declaration

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

Returns

IEnumerator<StructureElement>

An enumerator for the collection.

Implements IEnumerable<StructureElement>.GetEnumerator()

IndexOf(StructureElement)

Gets the zero‑based index of the specified element instance, or -1 if not found.

Declaration

cs-api-definition
public int IndexOf(StructureElement item)

Parameters

item

StructureElement

The structure element to locate in the collection.

Returns

int

The index of the structure element if found; otherwise, -1.

Implements IList<StructureElement>.IndexOf(StructureElement)

Insert(int, StructureElement)

Inserts the provided element at the given index, updating its parent reference.

Declaration

cs-api-definition
public void Insert(int index, StructureElement item)

Parameters

index

int

The zero-based index at which the structure element should be inserted.

item

StructureElement

The structure element to insert.

Implements IList<StructureElement>.Insert(int, StructureElement)

Remove(StructureElement)

Removes the first matching element, nulling its parent reference if found.

Declaration

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

Parameters

item

StructureElement

The structure element to remove.

Returns

bool

true if the structure element was successfully removed; otherwise, false.

Implements ICollection<StructureElement>.Remove(StructureElement)

RemoveAt(int)

Removes the element at the specified index and clears its parent reference.

Declaration

cs-api-definition
public void RemoveAt(int index)

Parameters

index

int

The zero-based index of the structure element to remove.

Implements IList<StructureElement>.RemoveAt(int)