QualifierDataCollection QualifierDataCollection QualifierDataCollection QualifierDataCollection Class

Definition

Represents a collection of QualifierData objects.

public ref class QualifierDataCollection : System::Collections::ICollection
public class QualifierDataCollection : System.Collections.ICollection
type QualifierDataCollection = class
    interface ICollection
    interface IEnumerable
Public Class QualifierDataCollection
Implements ICollection
Inheritance
QualifierDataCollectionQualifierDataCollectionQualifierDataCollectionQualifierDataCollection
Implements

Examples

The following example lists qualifier information about the Win32_Service class using the QualifierData class. For more information about Win32_Service, see the Windows Management Instrumentation documentation.

using System;
using System.Management;

public class Sample 
{    
    public static void Main() 
    {
        // Get the WMI class
        ManagementClass mClass = 
            new ManagementClass("Win32_Service");

        mClass.Options.UseAmendedQualifiers = true;

        // Get the Qualifiers for the class
        QualifierDataCollection qualifiers =
            mClass.Qualifiers;

        // display the Qualifier names
        Console.WriteLine(mClass.ClassPath.ClassName +
            " Qualifiers: ");
        foreach (QualifierData q in qualifiers)
        {
            Console.WriteLine(q.Name);
        }
        Console.WriteLine();
        
        Console.WriteLine("Class Description: ");
        Console.WriteLine(
            mClass.Qualifiers["Description"].Value);
    }
}
Imports System
Imports System.Management


Public Class Sample
    Public Overloads Shared Function _
        Main(ByVal args() As String) As Integer

        ' Get the WMI class
        Dim mClass As ManagementClass = _
            New ManagementClass("Win32_Service")

        mClass.Options.UseAmendedQualifiers = True

        ' Get the Qualifiers for the class
        Dim qualifiers As QualifierDataCollection = _
            mClass.Qualifiers()

        ' display the Qualifier names
        Console.WriteLine(mClass.ClassPath.ClassName & _
            " Qualifiers: ")
        For Each q As QualifierData In qualifiers
            Console.WriteLine(q.Name)
        Next

        Console.WriteLine()

        Console.WriteLine("Class Description: ")
        Console.WriteLine( _
            mClass.Qualifiers("Description").Value)


    End Function
End Class

Properties

Count Count Count Count

Gets the number of QualifierData objects in the QualifierDataCollection.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

Gets a value indicating whether the object is synchronized (thread-safe).

Item[String] Item[String] Item[String] Item[String]

Gets the specified QualifierData from the QualifierDataCollection.

SyncRoot SyncRoot SyncRoot SyncRoot

Gets the object to be used for synchronization.

Methods

Add(String, Object) Add(String, Object) Add(String, Object) Add(String, Object)

Adds a QualifierData to the QualifierDataCollection. This overload specifies the qualifier name and value.

Add(String, Object, Boolean, Boolean, Boolean, Boolean) Add(String, Object, Boolean, Boolean, Boolean, Boolean) Add(String, Object, Boolean, Boolean, Boolean, Boolean) Add(String, Object, Boolean, Boolean, Boolean, Boolean)

Adds a QualifierData to the QualifierDataCollection. This overload specifies all property values for a QualifierData.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

Copies the QualifierDataCollection into an array.

CopyTo(QualifierData[], Int32) CopyTo(QualifierData[], Int32) CopyTo(QualifierData[], Int32) CopyTo(QualifierData[], Int32)

Copies the QualifierDataCollection into a specialized QualifierData array.

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

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

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator for the QualifierDataCollection. This method is strongly typed.

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)
Remove(String) Remove(String) Remove(String) Remove(String)

Removes a QualifierData from the QualifierDataCollection by name.

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

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Returns an IEnumerator that iterates through the QualifierDataCollection.

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Applies to