PropertyDataCollection.PropertyDataEnumerator 클래스

정의

PropertyDataPropertyDataCollection 개체에 대한 열거자를 나타냅니다.

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
상속
PropertyDataCollection.PropertyDataEnumerator
구현

예제

다음 예제에서는 속성을 열거 합니다 Win32_LogicalDisk 클래스입니다.

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;
    }
}
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( _
            "Win32_LogicalDisk.DeviceID='C:'")
        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

PropertyDataCollection 열거형의 현재 PropertyData를 가져옵니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
MoveNext()

PropertyDataCollection 열거형의 다음 요소로 이동합니다.

Reset()

열거자를 PropertyDataCollection 열거형의 시작 부분을 가리키도록 다시 설정합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

IEnumerator.Current

컬렉션의 현재 개체를 가져옵니다.

적용 대상