New to Telerik Document ProcessingStart a free 30-day trial

Base for name-keyed collections that support enumeration and automatic conflict-free name generation.

Definition

Namespace:Telerik.Windows.Documents.Fixed.Model.Collections

Assembly:Telerik.Windows.Documents.Fixed.dll

Type Parameters:

T

Syntax:

C#
public abstract class NamedCollectionBase<T> : IEnumerable<T>, IEnumerable

Inheritance: objectNamedCollectionBase<T>

Derived Classes: EmbeddedFilesCollection

Implements: IEnumerableIEnumerable<T>

Constructors

Initializes a new instance of the NamedCollectionBase<T> class. Provides a thread-safe base for managing name-keyed collections with automatic name conflict resolution.

C#
protected NamedCollectionBase()

Methods

Return an enumerator that iterates through the collection of named objects.

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

IEnumerator<T>

An enumerator for the collection.

Implements: IEnumerable<T>.GetEnumerator()

Creates an incremented name by appending a numeric suffix to avoid naming conflicts.

C#
protected string IncrementFileName(ref int counter, string[] splitName, string fileName)
Parameters:counterint

The current counter value used for generating unique suffixes.

splitNamestring[]

The name components split by dot separators.

fileNamestring

The base file name without extension or numeric suffix.

Returns:

string

A new unique name with an incremented numeric suffix.

Generates an incremented version of the provided name if it already exists in the collection.

C#
protected abstract string IncrementFileNameOverride(ref int counter, string[] splitName, string fileName, string newName)
Parameters:counterint

The current counter value used for generating unique suffixes.

splitNamestring[]

The name components split by dot separators.

fileNamestring

The base file name without extension or numeric suffix.

newNamestring

The candidate new name to check for uniqueness.

Returns:

string

A unique name that doesn't conflict with existing names in the collection.

Validates that the collection has not exceeded its maximum capacity limit.

C#
protected abstract void VerifyCollectionLimit()