PropertyDataCollection.PropertyDataEnumerator Třída

Definice

Představuje enumerátor pro PropertyData objekty v objektu 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
Dědičnost
PropertyDataCollection.PropertyDataEnumerator
Implementuje

Příklady

Následující příklad uvádí vlastnosti třídy 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

Vlastnosti

Current

Získá proud PropertyData ve výčtu PropertyDataCollection .

Metody

Equals(Object)

Určí, zda se zadaný objekt rovná aktuálnímu objektu.

(Zděděno od Object)
GetHashCode()

Slouží jako výchozí hashovací funkce.

(Zděděno od Object)
GetType()

Získá aktuální Type instanci.

(Zděděno od Object)
MemberwiseClone()

Vytvoří mělkou kopii aktuálního Objectsouboru .

(Zděděno od Object)
MoveNext()

Přesune se na další prvek ve výčtu PropertyDataCollection .

Reset()

Obnoví výčet na začátek výčtu PropertyDataCollection .

ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Explicitní implementace rozhraní

IEnumerator.Current

Získá aktuální objekt v kolekci.

Platí pro