Class
FilteredShapeCollection<T>

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:

cs-api-definition
public abstract class FilteredShapeCollection<T> : IEnumerable<T>, IEnumerable where T : FloatingShapeBase

Inheritance: objectFilteredShapeCollection<T>

Derived Classes: ChartCollectionCommentCollectionImageCollectionNoteCollection

Implements: IEnumerableIEnumerable<T>

Properties

Count

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

Declaration

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

Property Value

int

The item count.

ShapeType

Gets the shape type that this collection filters and manages.

Declaration

cs-api-definition
public abstract FloatingShapeType ShapeType { get; }

Property Value

FloatingShapeType

Worksheet

Gets the worksheet that owns this shape collection.

Declaration

cs-api-definition
protected Worksheet Worksheet { get; }

Property Value

Worksheet

The worksheet.

this[int]

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

Declaration

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

Parameters

index

int

Property Value

T

Methods

Add(T)

Adds a shape to the collection and the underlying worksheet.

Declaration

cs-api-definition
public void Add(T item)

Parameters

item

T

The item.

Clear()

Removes all shapes of type T from the collection.

Declaration

cs-api-definition
public void Clear()

Contains(T)

Determines whether the collection contains the specified shape.

Declaration

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

Parameters

item

T

The note.

Returns

bool

A value indicating whether the collection contains the specified shape.

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration

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

Returns

IEnumerator<T>

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

Implements IEnumerable<T>.GetEnumerator()

GetZIndex(T)

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

Declaration

cs-api-definition
public int GetZIndex(T shape)

Parameters

shape

T

Returns

int

The zero-based ZIndex. If the item is not found in the collection, -1 is returned.

IndexOf(T)

Searches for the specified shape and returns its zero-based index, or -1 if not found.

Declaration

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

Parameters

item

T

The item.

Returns

int

The index of the item.

OnChanged(ShapeCollectionChangedEventArgs<T>)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnChanged(ShapeCollectionChangedEventArgs<T> args)

Parameters

args

ShapeCollectionChangedEventArgs<T>

The ShapeCollectionChangedEventArgs<T> instance containing the event data.

OnChanging(ShapeCollectionChangingEventArgs<T>)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnChanging(ShapeCollectionChangingEventArgs<T> args)

Parameters

args

ShapeCollectionChangingEventArgs<T>

The ShapeCollectionChangingEventArgs<T> instance containing the event data.

OnItemAdding(T, out ShapeCollectionChangingEventArgs<T>)

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

Declaration

cs-api-definition
protected void OnItemAdding(T shape, out ShapeCollectionChangingEventArgs<T> args)

Parameters

shape

T

args

ShapeCollectionChangingEventArgs<T>

OnItemRemoving(T, out ShapeCollectionChangingEventArgs<T>)

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

Declaration

cs-api-definition
protected void OnItemRemoving(T shape, out ShapeCollectionChangingEventArgs<T> args)

Parameters

shape

T

args

ShapeCollectionChangingEventArgs<T>

Remove(T)

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

Declaration

cs-api-definition
public virtual bool Remove(T item)

Parameters

item

T

The item.

Returns

bool

The value indicating whether the specified shape was found.

Events

Changed

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

Declaration

cs-api-definition
public event EventHandler<ShapeCollectionChangedEventArgs<T>> Changed

Event Value

EventHandler<ShapeCollectionChangedEventArgs<T>>

Changing

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

Declaration

cs-api-definition
public event EventHandler<ShapeCollectionChangingEventArgs<T>> Changing

Event Value

EventHandler<ShapeCollectionChangingEventArgs<T>>