PropertyDataCollection.PropertyDataEnumerator PropertyDataCollection.PropertyDataEnumerator PropertyDataCollection.PropertyDataEnumerator PropertyDataCollection.PropertyDataEnumerator Class


Represents the enumerator for PropertyData objects in the PropertyDataCollection.

public: ref class PropertyDataCollection::PropertyDataEnumerator : System::Collections::IEnumerator
public class PropertyDataCollection.PropertyDataEnumerator : System.Collections.IEnumerator
type PropertyDataCollection.PropertyDataEnumerator = class
    interface IEnumerator
Public Class PropertyDataCollection.PropertyDataEnumerator
Implements IEnumerator


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 
            propertyEnumerator = disk.Properties.GetEnumerator();
            PropertyData p = 
            Console.WriteLine("Property found: " + p.Name);
        return 0;
Imports System.Management

' This sample demonstrates how to
' enumerate all properties in a
' ManagementObject using
' PropertyDataEnumerator object.
Class Sample_PropertyDataEnumerator
    Public Overloads Shared Function _
        Main(ByVal args() As String) As Integer
        Dim disk As New ManagementObject( _
        Dim propertyEnumerator As _
          PropertyDataCollection.PropertyDataEnumerator _
              = disk.Properties.GetEnumerator()
        While propertyEnumerator.MoveNext()
            Dim p As PropertyData = _
                CType(propertyEnumerator.Current, PropertyData)
            Console.WriteLine("Property found: " & p.Name)
        End While
        Return 0
    End Function
End Class


Current Current Current Current

Gets the current PropertyData in the PropertyDataCollection enumeration.


Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MoveNext() MoveNext() MoveNext() MoveNext()

Moves to the next element in the PropertyDataCollection enumeration.

Reset() Reset() Reset() Reset()

Resets the enumerator to the beginning of the PropertyDataCollection enumeration.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IEnumerator.Current IEnumerator.Current IEnumerator.Current IEnumerator.Current

Gets the current object in the collection.

Applies to