Class NamedObjectList<T>
Provides an ordered collection of named objects with dictionary-style access by name and list-style ordering.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Documents.Spreadsheet.Core
Assembly: Telerik.Windows.Documents.Spreadsheet.dll
Syntax
public class NamedObjectList<T> : ICollection<T>, IEnumerable<T>, IEnumerable where T : INamedObject
Type Parameters
|
T
The type of the T. |
Constructors
NamedObjectList()
Properties
Count
Gets the number of elements contained in the System.Collections.Generic.ICollection<T>.
Declaration
public int Count { get; }
Property Value
|
System.Int32
The number of elements contained in the System.Collections.Generic.ICollection<T>. |
Implements
IsReadOnly
Gets a value indicating whether the System.Collections.Generic.ICollection<T> is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
|
System.Boolean
True if the System.Collections.Generic.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.
Declaration
public bool AddAfter(string previousItemName, T item)
Parameters
|
System.String
previousItemName
Name of the item after which the new item will be added. |
|
T
item
The new item. |
Returns
|
System.Boolean
|
AddBefore(String, T)
Inserts the new item immediately before the specified existing item in the collection.
Declaration
public bool AddBefore(string nextItemName, T item)
Parameters
|
System.String
nextItemName
Name of the next item. |
|
T
item
The new item. |
Returns
|
System.Boolean
|
AddFirst(T)
Adds the item at the beginning of the collection, making it the first element.
Declaration
public void AddFirst(T item)
Parameters
|
T
item
The item to add. |
AddLast(T)
Adds the item at the end of the collection.
Declaration
public void AddLast(T item)
Parameters
|
T
item
The item to add. |
Clear()
Removes all items from the System.Collections.Generic.ICollection<T>.
Declaration
public void Clear()
Implements
Exceptions
|
System.NotSupportedException
The System.Collections.Generic.ICollection<T> is read-only. |
Contains(T)
Determines whether the specified item is contained in the collection.
Declaration
public bool Contains(T item)
Parameters
|
T
item
The item to locate in the collection. |
Returns
|
System.Boolean
|
Implements
Contains(String)
Determines whether an item with the specified name exists in the collection.
Declaration
public bool Contains(string itemName)
Parameters
|
System.String
itemName
Name of the item. |
Returns
|
System.Boolean
|
CopyTo(T[], Int32)
Copies all items to the specified array starting at the given index.
Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
|
T[]
array
The array. |
|
System.Int32
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
|
System.String
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
|
System.Collections.Generic.IEnumerator<T>
A System.Collections.Generic.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
|
T
item
The item to remove. |
Returns
|
System.Boolean
|
Implements
Remove(String)
Removes the item with the specified name from the collection.
Declaration
public bool Remove(string itemName)
Parameters
|
System.String
itemName
Name of the item. |
Returns
|
System.Boolean
|
RemoveOverride(T)
Invoked immediately before removing an item, allowing derived classes to perform cleanup.
Declaration
protected virtual void RemoveOverride(T item)
Parameters
|
T
item
The item to remove. |
Explicit Interface Implementations
ICollection<T>.Add(T)
Adds the specified item.
Declaration
void ICollection<T>.Add(T item)
Parameters
|
T
item
The new item. |
Implements
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
|
System.Collections.IEnumerator
An System.Collections.IEnumerator object that can be used to iterate through the collection. |