Provides a typed view over a document element's children, applying child validation and raising collection notifications.
Definition
Namespace:Telerik.WinForms.Documents.Model
Assembly:Telerik.WinControls.RichTextEditor.dll
Type Parameters:
TInheritor
Syntax:
public abstract class SpecializedDocumentElementCollection<TInheritor> : IList, ICollection, IEnumerable where TInheritor : DocumentElement
Inheritance: objectSpecializedDocumentElementCollection<TInheritor>
Derived Classes:
Implements:
Properties
First
TInheritor
Gets the first child of this collection, or null when the collection is empty.
public TInheritor First { get; }
Gets the backing document-element collection for operations not exposed by the typed collection wrapper.
protected DocumentElementCollection InnerCollection { get; }
Gets whether the wrapped collection is read-only. The wrapped collection does not implement IList, so this cast cannot succeed.
public bool IsReadOnly { get; }
The wrapped collection is cast to IList.
Methods
Adds a DocumentElement to the collection.
public void Add(TInheritor item)
The object to add to the ICollection<T>.
Inserts a new child immediately after an existing child.
public void AddAfter(TInheritor item, TInheritor newItem)
The existing child that will precede the inserted element.
newItemTInheritorThe child to insert.
Inserts a new child immediately before an existing child.
public void AddBefore(TInheritor item, TInheritor newItem)
The existing child that will follow the inserted element.
newItemTInheritorThe child to insert.
Adds each element in the sequence through Add(TInheritor). Child validation and collection notifications therefore occur for each element.
public void AddRange(IEnumerable<TInheritor> range)
The elements to add in enumeration order.
Removes all child elements from the wrapped collection and raises CollectionChanged.
public void Clear()
Checks whether the wrapped collection contains an element. The wrapped implementation does not support this operation.
public bool Contains(TInheritor item)
The element to locate.
Returns:This method does not return.
Exceptions: NotImplementedExceptionThe wrapped collection's Contains(DocumentElement) method is called.
Copies the collection's elements to an array, beginning at the specified array index.
public void CopyTo(TInheritor[] array, int arrayIndex)
The destination array.
arrayIndexintThe zero-based destination index at which copying begins.
Detaches an element from the wrapped collection without raising CollectionChanged.
Returns an enumerator over the typed child elements.
public IEnumerator<TInheritor> GetEnumerator()
IEnumerator<TInheritor>
An enumerator that yields the collection's child elements.
Called when the collection is changed. Raises CollectionChanged event.
protected virtual void OnCollectionChanged()
Called when DocumentElement is added.
protected virtual void OnElementAdded(DocumentElement element)
The element.
Removes an element from the wrapped collection and raises CollectionChanged when removal succeeds.
Converts the collection to an array.
Provides a hook for derived collections to enforce additional rules before a child is added.
protected virtual void VerifyChildrenOverride(TInheritor item)
The child element being validated.
Events
Occurs when the collection is changed.
public event EventHandler CollectionChanged
Occurs when a DocumentElement is added.
public event EventHandler<ElementAddedEventArgs> ElementAdded