MapEnumerator.currentKey Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the key from the (key, value) pair that is currently pointed to by the enumerator.
public:
System::Object ^ currentKey();
public object currentKey ();
member this.currentKey : unit -> obj
Public Function currentKey () As Object
Returns
The key from the map element that is currently pointed to by the enumerator.
Remarks
You must call the MapEnumerator.moveNext method before you call the currentKey method.
The following example searches for a particular table ID in a map and then returns the key value of that map element.
private LabelType tableLabel(tableId _tableId)
{
LabelType labelType;
MapEnumerator mapEnum;
mapEnum = tableAllMap.getEnumerator();
while (mapEnum.moveNext())
{
if (_tableId == mapEnum.currentValue())
{
labelType = mapEnum.currentKey();
break;
}
}
return labelType;
}