NameObjectCollectionBase.BaseGet Method (String)
Gets the value of the first entry with the specified key from the NameObjectCollectionBase instance.
Assembly: System (in System.dll)
Parameters
- name
-
Type:
System.String
The String key of the entry to get. The key can be null.
Return Value
Type: System.ObjectAn Object that represents the value of the first entry with the specified key, if found; otherwise, null.
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.
Caution |
|---|
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.
The following code example uses BaseGetKey and BaseGet to get specific keys and values.
Available since 10
.NET Framework
Available since 1.1
.jpeg?cs-save-lang=1&cs-lang=fsharp)