PropertyDataCollection.PropertyDataEnumerator Class
.NET Framework 4
Represents the enumerator for PropertyData objects in the PropertyDataCollection.
Namespace:
System.Management
Assembly: System.Management (in System.Management.dll)
The PropertyDataCollection.PropertyDataEnumerator type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | MoveNext | Moves to the next element in the PropertyDataCollection enumeration. |
![]() | Reset | Resets the enumerator to the beginning of the PropertyDataCollection enumeration. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
The following example enumerates through the properties of the Win32_LogicalDisk class.
using System; using System.Management; // This sample demonstrates how to // enumerate all properties in a // ManagementObject using the // PropertyDataEnumerator object. class Sample_PropertyDataEnumerator { public static int Main(string[] args) { ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID='C:'"); PropertyDataCollection.PropertyDataEnumerator propertyEnumerator = disk.Properties.GetEnumerator(); while(propertyEnumerator.MoveNext()) { PropertyData p = (PropertyData)propertyEnumerator.Current; Console.WriteLine("Property found: " + p.Name); } return 0; } }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

