New to Telerik Document ProcessingStart a free 30-day trial

Provides an ordered collection of named objects with dictionary-style access by name and list-style ordering.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Core

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Type Parameters:

T

The type of the T.

Syntax:

C#
public class NamedObjectList<T> : ICollection<T>, IEnumerable<T>, IEnumerable where T : INamedObject

Inheritance: objectNamedObjectList<T>

Implements: ICollection<T>IEnumerableIEnumerable<T>

Constructors

Initializes a new instance of the NamedObjectList<T> class.

C#
public NamedObjectList()

Properties

Gets the number of elements contained in the ICollection<T>.

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

The number of elements contained in the ICollection<T>.

Implements: ICollection<T>.Count

Gets a value indicating whether the ICollection<T> is read-only.

C#
public bool IsReadOnly { get; }
Property Value:

True if the ICollection<T> is read-only; otherwise, false.

Implements: ICollection<T>.IsReadOnly

Methods

Inserts the new item immediately after the specified existing item in the collection.

C#
public bool AddAfter(string previousItemName, T item)
Parameters:previousItemNamestring

Name of the item after which the new item will be added.

itemT

The new item.

Returns:

bool

True if succeed.

Inserts the new item immediately before the specified existing item in the collection.

C#
public bool AddBefore(string nextItemName, T item)
Parameters:nextItemNamestring

Name of the next item.

itemT

The new item.

Returns:

bool

True if succeed.

Adds the item at the beginning of the collection, making it the first element.

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

The item to add.

Adds the item at the end of the collection.

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

The item to add.

Removes all items from the ICollection<T>.

C#
public void Clear()
Exceptions:

NotSupportedException

The ICollection<T> is read-only.

Implements: ICollection<T>.Clear()

Determines whether an item with the specified name exists in the collection.

C#
public bool Contains(string itemName)
Parameters:itemNamestring

Name of the item.

Returns:

bool

True if contained.

Determines whether the specified item is contained in the collection.

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

The item to locate in the collection.

Returns:

bool

True if contained.

Implements: ICollection<T>.Contains(T)

Copies all items to the specified array starting at the given index.

C#
public void CopyTo(T[] array, int arrayIndex)
Parameters:arrayT[]

The array.

arrayIndexint

Index of the array.

Implements: ICollection<T>.CopyTo(T[], int)

Retrieves the item with the specified name, or the default value if not found.

C#
public T GetByName(string itemName)
Parameters:itemNamestring

Name of the item.

Returns:

T

The item if exists, else the default value of the returned type.

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()

Removes the item with the specified name from the collection.

C#
public bool Remove(string itemName)
Parameters:itemNamestring

Name of the item.

Returns:

bool

True if succeed.

Removes the specified item.

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

The item to remove.

Returns:

bool

True if succeed.

Implements: ICollection<T>.Remove(T)

Invoked immediately before removing an item, allowing derived classes to perform cleanup.

C#
protected virtual void RemoveOverride(T item)
Parameters:itemT

The item to remove.