Modifica

Condividi tramite


QualifierDataCollection.QualifierDataEnumerator Class

Definition

Represents the enumerator for QualifierData objects in the QualifierDataCollection.

public: ref class QualifierDataCollection::QualifierDataEnumerator : System::Collections::IEnumerator
public class QualifierDataCollection.QualifierDataEnumerator : System.Collections.IEnumerator
type QualifierDataCollection.QualifierDataEnumerator = class
    interface IEnumerator
Public Class QualifierDataCollection.QualifierDataEnumerator
Implements IEnumerator
Inheritance
QualifierDataCollection.QualifierDataEnumerator
Implements

Examples

The following example enumerates through all the qualifiers in the Win32_LogicalDisk class and displays their values.

using System;
using System.Management;

// This sample demonstrates how to
// enumerate qualifiers of a ManagementClass
// using QualifierDataEnumerator object.
class Sample_QualifierDataEnumerator
{
    public static int Main(string[] args)
    {
        ManagementClass diskClass =
            new ManagementClass("Win32_LogicalDisk");
        diskClass.Options.UseAmendedQualifiers = true;
        QualifierDataCollection diskQualifier =
            diskClass.Qualifiers;
        QualifierDataCollection.QualifierDataEnumerator
            qualifierEnumerator =
            diskQualifier.GetEnumerator();
        while(qualifierEnumerator.MoveNext())
        {
            Console.WriteLine(
                qualifierEnumerator.Current.Name + " = " +
                qualifierEnumerator.Current.Value);
        }
        return 0;
    }
}
Imports System.Management

' This sample demonstrates how to
' enumerate qualifiers of a ManagementClass
' using QualifierDataEnumerator object.
Class Sample_QualifierDataEnumerator
    Public Overloads Shared Function _
        Main(ByVal args() As String) As Integer
        Dim diskClass As New _
            ManagementClass("win32_logicaldisk")
        diskClass.Options.UseAmendedQualifiers = True
        Dim diskQualifier As _
            QualifierDataCollection = diskClass.Qualifiers
        Dim qualifierEnumerator As _
            QualifierDataCollection.QualifierDataEnumerator = _
                diskQualifier.GetEnumerator()
        While qualifierEnumerator.MoveNext()
            Console.WriteLine( _
                qualifierEnumerator.Current.Name & _
                " = " & qualifierEnumerator.Current.Value)
        End While
        Return 0
    End Function
End Class

Properties

Current

Gets or sets the current QualifierData in the QualifierDataCollection enumeration.

Methods

Equals(Object)

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

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(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 QualifierDataCollection enumeration.

Reset()

Resets the enumerator to the beginning of the QualifierDataCollection enumeration.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IEnumerator.Current

Gets the current object in the collection.

Applies to