New to Telerik UI for WPFStart a free 30-day trial

Represents a collection of specialized document elements of type TInheritor.

Definition

Namespace:Telerik.Windows.Documents.Model

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Type Parameters:

TInheritor

The type of the elements in the collection.

Syntax:

C#
public abstract class SpecializedDocumentElementCollection<TInheritor> : ICollection<TInheritor>, IEnumerable<TInheritor>, IList, ICollection, IEnumerable where TInheritor : DocumentElement

Inheritance: objectSpecializedDocumentElementCollection<TInheritor>

Derived Classes: BlockCollectionInlineCollectionParagraphCollectionSectionCollectionTableCellCollectionTableRowCollection...

Implements: ICollectionICollection<TInheritor>IEnumerableIEnumerable<TInheritor>IList

Properties

Gets the number of elements contained in the collection.

C#
public int Count { get; }

Implements: ICollection<TInheritor>.Count

First

TInheritor

Gets the first element in the collection of specialized document elements.

C#
public TInheritor First { get; }
C#
protected DocumentElementCollection InnerCollection { get; }

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

C#
public bool IsReadOnly { get; }

Implements: ICollection<TInheritor>.IsReadOnly

Last

TInheritor

Gets the last element in the collection of specialized document elements.

C#
public TInheritor Last { get; }

Methods

Adds a DocumentElement to the collection.

C#
public void Add(TInheritor item)
Parameters:itemTInheritor

The object to add to the ICollection<T>.

Implements: ICollection<TInheritor>.Add(TInheritor)

Adds a new element of type TInheritor after a specified existing element in the collection.

C#
public void AddAfter(TInheritor item, TInheritor newItem)
Parameters:itemTInheritor

The element after which the new element will be added.

newItemTInheritor

The new element to be added to the collection.

Adds a new element before a specified existing element in the collection.

C#
public void AddBefore(TInheritor item, TInheritor newItem)
Parameters:itemTInheritor

The new element to be added to the collection.

newItemTInheritor

The existing element before which the new element will be inserted.

Adds a collection of elements to the specialized document element collection.

C#
public void AddRange(IEnumerable<TInheritor> range)
Parameters:rangeIEnumerable<TInheritor>

The collection of elements to add to the collection.

Clears all elements from the collection.

C#
public void Clear()

Implements: ICollection<TInheritor>.Clear()

Remarks:

This method removes all items from the current collection, resetting it to an empty state.

Determines whether the collection contains a specific element.

C#
public bool Contains(TInheritor item)
Parameters:itemTInheritor

The element to locate in the collection.

Returns:

bool

true if the collection contains the element; otherwise, false.

Implements: ICollection<TInheritor>.Contains(TInheritor)

Copies the elements of the collection to a specified array, starting at a particular index.

C#
public void CopyTo(TInheritor[] array, int arrayIndex)
Parameters:arrayTInheritor[]

The one-dimensional array that is the destination of the elements copied from the collection. The array must have a zero-based index.

arrayIndexint

The zero-based index in the destination array at which storing the copied elements will begin.

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

Detaches the specified element from the collection.

C#
public bool Detach(TInheritor item)
Parameters:itemTInheritor

The element to be detached from the collection.

Returns:

bool

Returns the detached element.

Returns an enumerator that iterates through the collection of specialized document elements.

C#
public IEnumerator<TInheritor> GetEnumerator()
Returns:

IEnumerator<TInheritor>

A enumerator that provides iteration over the current collection of specialized document elements.

Implements: IEnumerable<TInheritor>.GetEnumerator()

Called when the collection is changed. Raises CollectionChanged event.

C#
protected virtual void OnCollectionChanged()

Called when DocumentElement is added.

C#
protected virtual void OnElementAdded(DocumentElement element)
Parameters:elementDocumentElement

The element.

Removes the specified element from the collection.

C#
public bool Remove(TInheritor item)
Parameters:itemTInheritor

The element to be removed from the collection.

Returns:

bool

True if the element was successfully removed; otherwise, false.

Implements: ICollection<TInheritor>.Remove(TInheritor)

ToArray()

TInheritor[]

Converts the collection to an array.

C#
public TInheritor[] ToArray()
Returns:

TInheritor[]

An array of DocumentElements.

C#
protected virtual void VerifyChildrenOverride(TInheritor item)
Parameters:itemTInheritor

Events

Occurs when the collection is changed.

C#
public event EventHandler CollectionChanged

Occurs when a DocumentElement is added.

C#
public event EventHandler<ElementAddedEventArgs> ElementAdded