System.Collections.Specialized.NameObjectCollectionBase Class

Provides the abstract base class for a collection of associated string keys and object values that can be accessed either with the key or with the index.

See Also: NameObjectCollectionBase Members


public abstract class NameObjectCollectionBase : ICollection, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable


The underlying structure for this class is a hash table.

Each element is a key/value pair.

The capacity of a System.Collections.Specialized.NameObjectCollectionBase is the number of elements the System.Collections.Specialized.NameObjectCollectionBase can hold. As elements are added to a System.Collections.Specialized.NameObjectCollectionBase, the capacity is automatically increased as required through reallocation.

The hash code provider dispenses hash codes for keys in the System.Collections.Specialized.NameObjectCollectionBase instance. The default hash code provider is the CaseInsensitiveHashCodeProvider.

The comparer determines whether two keys are equal. The default comparer is the CaseInsensitiveComparer.

In .NET Framework version 1.0, this class uses culture-sensitive string comparisons. However, in .NET Framework version 1.1 and later, this class uses System.Globalization.CultureInfo.InvariantCulture when comparing strings. For more information about how culture affects comparisons and sorting, see Comparing and Sorting Data for a Specific Culture and Performing Culture-Insensitive String Operations.

null is allowed as a key or as a value.


The NameObjectCollectionBase.BaseGet(string) method does not distinguish between null which is returned because the specified key is not found and null which is returned because the value associated with the key is null.


Namespace: System.Collections.Specialized
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0,,