Base collection for managing typed subsets of worksheet shapes, enabling filtered access and modification to shapes by type.
Definition
Namespace:Telerik.Windows.Documents.Spreadsheet.Model
Assembly:Telerik.Windows.Documents.Spreadsheet.dll
Type Parameters:
T
The type of the shape.
Syntax:
public abstract class FilteredShapeCollection<T> : IEnumerable<T>, IEnumerable where T : FloatingShapeBase
Inheritance: objectFilteredShapeCollection<T>
Derived Classes:
Implements:
Events
Raised after a shape is added, removed, or the collection is cleared.
public event EventHandler<ShapeCollectionChangedEventArgs<T>> Changed
Raised before a shape is added or removed, allowing the operation to be canceled.
public event EventHandler<ShapeCollectionChangingEventArgs<T>> Changing
Methods
Adds a shape to the collection and the underlying worksheet.
public void Add(T item)
The item.
Removes all shapes of type T from the collection.
public void Clear()
Determines whether the collection contains the specified shape.
public bool Contains(T item)
The note.
Returns:A value indicating whether the collection contains the specified shape.
Returns an enumerator that iterates through the collection.
public IEnumerator<T> GetEnumerator()
IEnumerator<T>
A IEnumerator<T> that can be used to iterate through the collection.
Implements:
Gets the layering order (ZIndex) of the specified shape, or -1 if not found.
public int GetZIndex(T shape)
The zero-based ZIndex. If the item is not found in the collection, -1 is returned.
Searches for the specified shape and returns its zero-based index, or -1 if not found.
Raises the event.
protected virtual void OnChanged(ShapeCollectionChangedEventArgs<T> args)
The ShapeCollectionChangedEventArgs<T> instance containing the event data.
Raises the event.
protected virtual void OnChanging(ShapeCollectionChangingEventArgs<T> args)
The ShapeCollectionChangingEventArgs<T> instance containing the event data.
Invoked before adding a shape to the collection, enabling cancellation via the event args.
protected void OnItemAdding(T shape, out ShapeCollectionChangingEventArgs<T> args)
Invoked before removing a shape from the collection, enabling cancellation via the event args.
protected void OnItemRemoving(T shape, out ShapeCollectionChangingEventArgs<T> args)
Properties
Gets the number of shapes of type T in the collection.
public int Count { get; }
The item count.
Gets the shape type that this collection filters and manages.
public abstract FloatingShapeType ShapeType { get; }
Gets the shape at the specified zero-based index within the filtered collection.