Map.keySet 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 a set that contains the key values from a map.
public:
Microsoft::Dynamics::Ax::Xpp::Set ^ keySet();
public Microsoft.Dynamics.Ax.Xpp.Set keySet ();
member this.keySet : unit -> Microsoft.Dynamics.Ax.Xpp.Set
Public Function keySet () As Set
Returns
A set that contains the key values.
Remarks
The following example deletes all elements from a map that have key values that are not found as elements in a set.
public void deleteItems(Set _set, Map _map)
{
Set deletedSet;
SetEnumerator enumerator;
// deletedSet contains all key values from
// _map that are not values in _set
deletedSet = Set::difference(_map.keySet(), _set);
enumerator = deletedSet.getEnumerator();
while (enumerator.moveNext())
{
// Deletes elements from map with key
// values matching values in deletedSet
_map.remove(enumerator.current());
}
}