Click or drag to resize
DigitalRuneNamedObjectCollectionT Class
Stores objects by their names.
Inheritance Hierarchy
SystemObject
  System.Collections.ObjectModelCollectionT
    System.Collections.ObjectModelKeyedCollectionString, T
      DigitalRune.CollectionsNamedObjectCollectionT
        More...

Namespace: DigitalRune.Collections
Assembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax
public class NamedObjectCollection<T> : KeyedCollection<string, T>
where T : INamedObject

Type Parameters

T
The type of the objects. Must be derived from INamedObject.

The NamedObjectCollectionT type exposes the following members.

Constructors
  NameDescription
Public methodNamedObjectCollectionT
Initializes a new instance of the NamedObjectCollectionT class.
Public methodNamedObjectCollectionT(IEqualityComparerString)
Initializes a new instance of the NamedObjectCollectionT class using the given comparer.
Public methodNamedObjectCollectionT(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.
Top
Methods
  NameDescription
Public methodAdd (Inherited from CollectionT.)
Public methodAddRange
Adds the elements of the specified collection to the end of the NamedObjectCollectionT.
Protected methodChangeItemKey
Changes the key associated with the specified element in the lookup dictionary.
(Inherited from KeyedCollectionString, T.)
Public methodClear (Inherited from CollectionT.)
Protected methodClearItems (Overrides KeyedCollectionTKey, TItemClearItems.)
Public methodContains(TKey)
Determines whether the collection contains an element with the specified key.
(Inherited from KeyedCollectionString, T.)
Public methodContains(T) (Inherited from CollectionT.)
Public methodCopyTo (Inherited from CollectionT.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetEnumerator
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Protected methodGetKeyForItem
When implemented in a derived class, extracts the key from the specified element.
(Overrides KeyedCollectionTKey, TItemGetKeyForItem(TItem).)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf (Inherited from CollectionT.)
Public methodInsert (Inherited from CollectionT.)
Protected methodInsertItem (Overrides KeyedCollectionTKey, TItemInsertItem(Int32, TItem).)
Public methodInsertRange
Inserts the elements of a collection into the NamedObjectCollectionT at the specified index.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMove
Moves the item at the specified index to a new location in the collection.
Protected methodMoveItem
Moves the item at the specified index to a new location in the collection.
Protected methodOnCollectionChanged
Raises the CollectionChanged event.
Public methodRemove(TKey) (Inherited from KeyedCollectionString, T.)
Public methodRemove(T) (Inherited from CollectionT.)
Public methodRemoveAt (Inherited from CollectionT.)
Protected methodRemoveItem (Overrides KeyedCollectionTKey, TItemRemoveItem(Int32).)
Public methodRemoveRange
Removes a range of elements from the NamedObjectCollectionT.
Protected methodSetItem
Replaces the item at the specified index with the specified item.
(Overrides KeyedCollectionTKey, TItemSetItem(Int32, TItem).)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTryGet(String, T)
Gets the object associated with the specified key.
Public methodTryGetTExpected(String, TExpected)
Gets the object associated with the specified key. The object needs to be of a certain type.
Top
Properties
  NameDescription
Public propertyComparer
Gets the generic equality comparer that is used to determine equality of keys in the collection.
(Inherited from KeyedCollectionString, T.)
Public propertyCount (Inherited from CollectionT.)
Protected propertyDictionary (Inherited from KeyedCollectionString, T.)
Public propertyItemTKey
Gets the element with the specified key.
(Inherited from KeyedCollectionString, T.)
Public propertyItemInt32
Gets or sets the element at the specified index.
(Inherited from CollectionT.)
Protected propertyItems (Inherited from CollectionT.)
Top
Events
  NameDescription
Public eventCollectionChanged
Occurs when items were added, replaced or removed.
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate methodIListAdd
Adds an item to the IList.
(Inherited from CollectionT.)
Explicit interface implementationPrivate methodIListContains
Determines whether the IList contains a specific value.
(Inherited from CollectionT.)
Explicit interface implementationPrivate methodICollectionCopyTo
Copies the elements of the ICollection to an Array, starting at a particular Array index.
(Inherited from CollectionT.)
Explicit interface implementationPrivate methodIEnumerableGetEnumerator
Returns an enumerator that iterates through a collection.
(Inherited from CollectionT.)
Explicit interface implementationPrivate methodIListIndexOf
Determines the index of a specific item in the IList.
(Inherited from CollectionT.)
Explicit interface implementationPrivate methodIListInsert
Inserts an item into the IList at the specified index.
(Inherited from CollectionT.)
Explicit interface implementationPrivate propertyIListIsFixedSize
Gets a value indicating whether the IList has a fixed size.
(Inherited from CollectionT.)
Explicit interface implementationPrivate propertyICollectionTIsReadOnly (Inherited from CollectionT.)
Explicit interface implementationPrivate propertyIListIsReadOnly
Gets a value indicating whether the IList is read-only.
(Inherited from CollectionT.)
Explicit interface implementationPrivate propertyICollectionIsSynchronized
Gets a value indicating whether access to the ICollection is synchronized (thread safe).
(Inherited from CollectionT.)
Explicit interface implementationPrivate propertyIListItem
Gets or sets the element at the specified index.
(Inherited from CollectionT.)
Explicit interface implementationPrivate methodIListRemove
Removes the first occurrence of a specific object from the IList.
(Inherited from CollectionT.)
Explicit interface implementationPrivate propertyICollectionSyncRoot
Gets an object that can be used to synchronize access to the ICollection.
(Inherited from CollectionT.)
Top
Remarks

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.

See Also
Inheritance Hierarchy
SystemObject
  System.Collections.ObjectModelCollectionT
    System.Collections.ObjectModelKeyedCollectionString, T
      DigitalRune.CollectionsNamedObjectCollectionT
        DigitalRune.DiagnosticsProfilerDataCollection
        DigitalRune.GameGameObjectCollection
        DigitalRune.Game.InputInputCommandCollection
        DigitalRune.Game.StatesStateCollection
        DigitalRune.Game.UIUIScreenCollection
        DigitalRune.GraphicsMorphTargetCollection