MenuItemCollection::GetEnumerator Method
Returns an enumerator that can be used to iterate through the items in the current MenuItemCollection object.
Assembly: System.Web (in System.Web.dll)
Return Value
Type: System.Collections::IEnumeratorAn enumerator that can be used to iterate through the items in the current MenuItemCollection.
Implements
IEnumerable::GetEnumerator()Use the GetEnumerator method to create an enumerator that can be easily iterated through to get each item in the current MenuItemCollection object. To get the item currently pointed to in the enumerator, use the Current property. Use the MoveNext method to move to the next item. If you need to move the enumerator back to the beginning of the collection, use the Reset method.
Note: |
|---|
After you create an enumerator or use the Reset method, you must call the MoveNext method. Otherwise, the item represented by the Current property is undefined. |
As an alternative, you can also use the CopyTo method to copy the items in the collection to an array. You can then use the array to access the items in the collection.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: