ClassNamedObjectList<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:
public class NamedObjectList<T> : ICollection<T>, IEnumerable<T>, IEnumerable where T : INamedObject
Inheritance: objectNamedObjectList<T>
Implements:
Constructors
NamedObjectList()
Initializes a new instance of the NamedObjectList<T> class.
Declaration
public NamedObjectList()
Properties
Count
Gets the number of elements contained in the ICollection<T>.
Declaration
public int Count { get; }
Property Value
The number of elements contained in the ICollection<T>.
Implements
IsReadOnly
Gets a value indicating whether the ICollection<T> is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
True if the ICollection<T> is read-only; otherwise, false.
Implements
Methods
AddAfter(string, T)
Inserts the new item immediately after the specified existing item in the collection.
AddBefore(string, T)
Inserts the new item immediately before the specified existing item in the collection.
AddFirst(T)
Adds the item at the beginning of the collection, making it the first element.
Declaration
public void AddFirst(T item)
Parameters
item
T
The item to add.
AddLast(T)
Adds the item at the end of the collection.
Declaration
public void AddLast(T item)
Parameters
item
T
The item to add.
Clear()
Removes all items from the ICollection<T>.
Declaration
public void Clear()
Exceptions
The ICollection<T> is read-only.
Implements
Contains(T)
Determines whether the specified item is contained in the collection.
Declaration
public bool Contains(T item)
Parameters
item
T
The item to locate in the collection.
Returns
True if contained.
Implements
Contains(string)
Determines whether an item with the specified name exists in the collection.
CopyTo(T[], int)
Copies all items to the specified array starting at the given index.
Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
array
T[]
The array.
arrayIndex
Index of the array.
Implements
GetByName(string)
Retrieves the item with the specified name, or the default value if not found.
Declaration
public T GetByName(string itemName)
Parameters
itemName
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
public IEnumerator<T> GetEnumerator()
Returns
IEnumerator<T>
A IEnumerator<T> that can be used to iterate through the collection.
Implements
Remove(T)
Removes the specified item.
Declaration
public bool Remove(T item)
Parameters
item
T
The item to remove.
Returns
True if succeed.
Implements
Remove(string)
Removes the item with the specified name from the collection.
RemoveOverride(T)
Invoked immediately before removing an item, allowing derived classes to perform cleanup.
Declaration
protected virtual void RemoveOverride(T item)
Parameters
item
T
The item to remove.