NamedObjectCollectionT Class |
Namespace: DigitalRune.Collections
public class NamedObjectCollection<T> : KeyedCollection<string, T> where T : INamedObject
The NamedObjectCollectionT type exposes the following members.
Name | Description | |
---|---|---|
NamedObjectCollectionT |
Initializes a new instance of the NamedObjectCollectionT class.
| |
NamedObjectCollectionT(IEqualityComparerString) |
Initializes a new instance of the NamedObjectCollectionT class using the
given comparer.
| |
NamedObjectCollectionT(IEqualityComparerString, Int32) |
Initializes a new instance of the NamedObjectCollectionT class that uses the
specified equality comparer and creates a lookup dictionary when the specified threshold is
exceeded.
|
Name | Description | |
---|---|---|
Add | Adds an object to the end of the CollectionT. (Inherited from CollectionT.) | |
AddRange |
Adds the elements of the specified collection to the end of the
NamedObjectCollectionT.
| |
ChangeItemKey | Changes the key associated with the specified element in the lookup dictionary. (Inherited from KeyedCollectionString, T.) | |
Clear | Removes all elements from the CollectionT. (Inherited from CollectionT.) | |
ClearItems |
Removes all elements from the KeyedCollectionTKey, TItem.
(Overrides KeyedCollectionTKey, TItemClearItems.) | |
Contains(TKey) | Determines whether the collection contains an element with the specified key. (Inherited from KeyedCollectionString, T.) | |
Contains(T) | Determines whether an element is in the CollectionT. (Inherited from CollectionT.) | |
CopyTo | Copies the entire CollectionT to a compatible one-dimensional Array, starting at the specified index of the target array. (Inherited from CollectionT.) | |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetEnumerator |
Returns an enumerator that iterates through the KeyedCollectionTKey, TItem.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetKeyForItem |
When implemented in a derived class, extracts the key from the specified element.
(Overrides KeyedCollectionTKey, TItemGetKeyForItem(TItem).) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IndexOf | Searches for the specified object and returns the zero-based index of the first occurrence within the entire CollectionT. (Inherited from CollectionT.) | |
Insert | Inserts an element into the CollectionT at the specified index. (Inherited from CollectionT.) | |
InsertItem |
Inserts an element into the KeyedCollectionTKey, TItem at the specified
index.
(Overrides KeyedCollectionTKey, TItemInsertItem(Int32, TItem).) | |
InsertRange |
Inserts the elements of a collection into the NamedObjectCollectionT at the
specified index.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Move |
Moves the item at the specified index to a new location in the collection.
| |
MoveItem |
Moves the item at the specified index to a new location in the collection.
| |
OnCollectionChanged |
Raises the CollectionChanged event.
| |
Remove(TKey) | Removes the element with the specified key from the KeyedCollectionTKey, TItem. (Inherited from KeyedCollectionString, T.) | |
Remove(T) | Removes the first occurrence of a specific object from the CollectionT. (Inherited from CollectionT.) | |
RemoveAt | Removes the element at the specified index of the CollectionT. (Inherited from CollectionT.) | |
RemoveItem |
Removes the element at the specified index of the KeyedCollectionTKey, TItem.
(Overrides KeyedCollectionTKey, TItemRemoveItem(Int32).) | |
RemoveRange |
Removes a range of elements from the NamedObjectCollectionT.
| |
SetItem |
Replaces the item at the specified index with the specified item.
(Overrides KeyedCollectionTKey, TItemSetItem(Int32, TItem).) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
TryGet(String, T) |
Gets the object associated with the specified key.
| |
TryGetTExpected(String, TExpected) |
Gets the object associated with the specified key. The object needs to be of a certain type.
|
Name | Description | |
---|---|---|
Comparer | Gets the generic equality comparer that is used to determine equality of keys in the collection. (Inherited from KeyedCollectionString, T.) | |
Count | Gets the number of elements actually contained in the CollectionT. (Inherited from CollectionT.) | |
Dictionary | Gets the lookup dictionary of the KeyedCollectionTKey, TItem. (Inherited from KeyedCollectionString, T.) | |
ItemTKey | Gets the element with the specified key. (Inherited from KeyedCollectionString, T.) | |
ItemInt32 | Gets or sets the element at the specified index. (Inherited from CollectionT.) | |
Items | Gets a IListT wrapper around the CollectionT. (Inherited from CollectionT.) |
Name | Description | |
---|---|---|
CollectionChanged |
Occurs when items were added, replaced or removed.
|
Name | Description | |
---|---|---|
IListAdd | Adds an item to the IList. (Inherited from CollectionT.) | |
IListContains | Determines whether the IList contains a specific value. (Inherited from CollectionT.) | |
ICollectionCopyTo | (Inherited from CollectionT.) | |
IEnumerableGetEnumerator | Returns an enumerator that iterates through a collection. (Inherited from CollectionT.) | |
IListIndexOf | Determines the index of a specific item in the IList. (Inherited from CollectionT.) | |
IListInsert | Inserts an item into the IList at the specified index. (Inherited from CollectionT.) | |
IListIsFixedSize | Gets a value indicating whether the IList has a fixed size. (Inherited from CollectionT.) | |
ICollectionTIsReadOnly | Gets a value indicating whether the ICollectionT is read-only. (Inherited from CollectionT.) | |
IListIsReadOnly | Gets a value indicating whether the IList is read-only. (Inherited from CollectionT.) | |
ICollectionIsSynchronized | Gets a value indicating whether access to the ICollection is synchronized (thread safe). (Inherited from CollectionT.) | |
IListItem | Gets or sets the element at the specified index. (Inherited from CollectionT.) | |
IListRemove | Removes the first occurrence of a specific object from the IList. (Inherited from CollectionT.) | |
ICollectionSyncRoot | Gets an object that can be used to synchronize access to the ICollection. (Inherited from CollectionT.) |
This collection stores INamedObjects. The name of each object is used as key when inserting a new object. The collection ensures that each object is properly named.
The NamedObjectCollectionT assumes that the names of the objects are constant. The collection might not work as expected if the object's names are changed while they are part of the collection.