Class
NamedObjectList<T>

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:

cs-api-definition
public class NamedObjectList<T> : ICollection<T>, IEnumerable<T>, IEnumerable where T : INamedObject

Inheritance: objectNamedObjectList<T>

Implements: ICollection<T>IEnumerableIEnumerable<T>

Constructors

NamedObjectList()

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

Declaration

cs-api-definition
public NamedObjectList()

Properties

Count

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

Declaration

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

Property Value

int

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

Implements ICollection<T>.Count

IsReadOnly

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

Declaration

cs-api-definition
public bool IsReadOnly { get; }

Property Value

bool

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

Implements ICollection<T>.IsReadOnly

Methods

AddAfter(string, T)

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

Declaration

cs-api-definition
public bool AddAfter(string previousItemName, T item)

Parameters

previousItemName

string

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

item

T

The new item.

Returns

bool

True if succeed.

AddBefore(string, T)

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

Declaration

cs-api-definition
public bool AddBefore(string nextItemName, T item)

Parameters

nextItemName

string

Name of the next item.

item

T

The new item.

Returns

bool

True if succeed.

AddFirst(T)

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

Declaration

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

Parameters

item

T

The item to add.

AddLast(T)

Adds the item at the end of the collection.

Declaration

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

Parameters

item

T

The item to add.

Clear()

Removes all items from the ICollection<T>.

Declaration

cs-api-definition
public void Clear()

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Implements ICollection<T>.Clear()

Contains(T)

Determines whether the specified item is contained in the collection.

Declaration

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

Parameters

item

T

The item to locate in the collection.

Returns

bool

True if contained.

Implements ICollection<T>.Contains(T)

Contains(string)

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

Declaration

cs-api-definition
public bool Contains(string itemName)

Parameters

itemName

string

Name of the item.

Returns

bool

True if contained.

CopyTo(T[], int)

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

Declaration

cs-api-definition
public void CopyTo(T[] array, int arrayIndex)

Parameters

array

T[]

The array.

arrayIndex

int

Index of the array.

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

GetByName(string)

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

Declaration

cs-api-definition
public T GetByName(string itemName)

Parameters

itemName

string

Name of the item.

Returns

T

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

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

Remove(T)

Removes the specified item.

Declaration

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

Parameters

item

T

The item to remove.

Returns

bool

True if succeed.

Implements ICollection<T>.Remove(T)

Remove(string)

Removes the item with the specified name from the collection.

Declaration

cs-api-definition
public bool Remove(string itemName)

Parameters

itemName

string

Name of the item.

Returns

bool

True if succeed.

RemoveOverride(T)

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

Declaration

cs-api-definition
protected virtual void RemoveOverride(T item)

Parameters

item

T

The item to remove.