New to Telerik Document ProcessingStart a free 30-day trial

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:

C#
public abstract class FilteredShapeCollection<T> : IEnumerable<T>, IEnumerable where T : FloatingShapeBase

Inheritance: objectFilteredShapeCollection<T>

Derived Classes: ChartCollectionCommentCollectionImageCollectionNoteCollection

Implements: IEnumerableIEnumerable<T>

Events

Raised after a shape is added, removed, or the collection is cleared.

C#
public event EventHandler<ShapeCollectionChangedEventArgs<T>> Changed

Raised before a shape is added or removed, allowing the operation to be canceled.

C#
public event EventHandler<ShapeCollectionChangingEventArgs<T>> Changing

Methods

Adds a shape to the collection and the underlying worksheet.

C#
public void Add(T item)
Parameters:itemT

The item.

Removes all shapes of type T from the collection.

C#
public void Clear()

Determines whether the collection contains the specified shape.

C#
public bool Contains(T item)
Parameters:itemT

The note.

Returns:

bool

A value indicating whether the collection contains the specified shape.

Returns an enumerator that iterates through the collection.

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

IEnumerator<T>

A IEnumerator<T> that can be used to iterate through the collection.

Implements: IEnumerable<T>.GetEnumerator()

Gets the layering order (ZIndex) of the specified shape, or -1 if not found.

C#
public int GetZIndex(T shape)
Parameters:shapeTReturns:

int

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.

C#
public int IndexOf(T item)
Parameters:itemT

The item.

Returns:

int

The index of the item.

Raises the event.

C#
protected virtual void OnChanged(ShapeCollectionChangedEventArgs<T> args)
Parameters:argsShapeCollectionChangedEventArgs<T>

The ShapeCollectionChangedEventArgs<T> instance containing the event data.

Raises the event.

C#
protected virtual void OnChanging(ShapeCollectionChangingEventArgs<T> args)
Parameters:argsShapeCollectionChangingEventArgs<T>

The ShapeCollectionChangingEventArgs<T> instance containing the event data.

Invoked before adding a shape to the collection, enabling cancellation via the event args.

C#
protected void OnItemAdding(T shape, out ShapeCollectionChangingEventArgs<T> args)
Parameters:shapeTargsShapeCollectionChangingEventArgs<T>

Invoked before removing a shape from the collection, enabling cancellation via the event args.

C#
protected void OnItemRemoving(T shape, out ShapeCollectionChangingEventArgs<T> args)
Parameters:shapeTargsShapeCollectionChangingEventArgs<T>

Removes the specified shape from the collection and returns whether it was found and removed.

C#
public virtual bool Remove(T item)
Parameters:itemT

The item.

Returns:

bool

The value indicating whether the specified shape was found.

Properties

Gets the number of shapes of type T in the collection.

C#
public int Count { get; }
Property Value:

The item count.

Gets the shape type that this collection filters and manages.

C#
public abstract FloatingShapeType ShapeType { get; }

Gets the shape at the specified zero-based index within the filtered collection.

C#
public T this[int index] { get; }
Parameters:indexint

Gets the worksheet that owns this shape collection.

C#
protected Worksheet Worksheet { get; }
Property Value:

The worksheet.