System.Collections.Specialized.NameObjectCollectionBase.BaseGet Method

Gets the value of the first entry with the specified key from the System.Collections.Specialized.NameObjectCollectionBase instance.

Syntax

protected object BaseGet (string name)

Parameters

name
The string key of the entry to get. The key can be null.

Returns

An object that represents the value of the first entry with the specified key, if found; otherwise, null.

Remarks

If the collection contains multiple entries with the specified key, this method returns only the first entry. To get the values of subsequent entries with the same key, use the enumerator to iterate through the collection and compare the keys.

Note:

This method returns null in the following cases: 1) if the specified key is not found; and 2) if the specified key is found and its associated value is null. This method does not distinguish between the two cases.

This method is an O(1) operation.

Requirements

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