PropertyDataCollection 클래스

정의

WMI 개체의 속성 집합을 나타냅니다.

public ref class PropertyDataCollection : System::Collections::ICollection
public class PropertyDataCollection : System.Collections.ICollection
type PropertyDataCollection = class
    interface ICollection
    interface IEnumerable
Public Class PropertyDataCollection
Implements ICollection
상속
PropertyDataCollection
구현

예제

다음 예제에 대 한 정보를 나열 합니다 Win32_OperatingSystem 를 사용 하 여 클래스를 PropertyData 클래스. Win32_OperatingSystem 대한 자세한 내용은 Windows 관리 계측 설명서를 참조하세요.

using System;
using System.Management;

public class Sample
{
    public static void Main()
    {

        // Get the WMI class
        ManagementClass osClass =
            new ManagementClass("Win32_OperatingSystem");

        osClass.Options.UseAmendedQualifiers = true;

        // Get the Properties in the class
        PropertyDataCollection properties =
            osClass.Properties;

        // display the Property names
        Console.WriteLine("Property Name: ");
        foreach (PropertyData property in properties)
        {
            Console.WriteLine(
                "---------------------------------------");
            Console.WriteLine(property.Name);
            Console.WriteLine("Description: " +
                property.Qualifiers["Description"].Value);
            Console.WriteLine();

            Console.WriteLine("Type: ");
            Console.WriteLine(property.Type);

            Console.WriteLine();

            Console.WriteLine("Qualifiers: ");
            foreach(QualifierData q in
                property.Qualifiers)
            {
                Console.WriteLine(q.Name);
            }
            Console.WriteLine();

            foreach (ManagementObject c in osClass.GetInstances())
            {
                Console.WriteLine("Value: ");
                Console.WriteLine(
                    c.Properties[property.Name.ToString()].Value);

                Console.WriteLine();
            }
        }
    }
}
Imports System.Management


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

        ' Get the WMI class
        Dim osClass As ManagementClass = _
            New ManagementClass("Win32_OperatingSystem")

        osClass.Options.UseAmendedQualifiers = True

        ' Get the Properties in the class
        Dim properties As PropertyDataCollection = _
            osClass.Properties

        ' display the Property names
        Console.WriteLine("Property Name: ")
        For Each p As PropertyData In properties

            Console.WriteLine( _
                "---------------------------------------")
            Console.WriteLine(p.Name)
            Console.WriteLine("Description: " & _
                p.Qualifiers("Description").Value)
            Console.WriteLine()

            Console.WriteLine("Type: ")
            Console.WriteLine(p.Type)

            Console.WriteLine()

            Console.WriteLine("Qualifiers: ")
            For Each q As QualifierData In _
                p.Qualifiers

                Console.WriteLine(q.Name)
            Next
            Console.WriteLine()

            For Each c As ManagementObject In osClass.GetInstances()

                Console.WriteLine("Value: ")
                Console.WriteLine( _
                    c.Properties(p.Name.ToString()).Value)

                Console.WriteLine()
            Next
        Next

    End Function
End Class

속성

Count

PropertyDataCollection의 개체 수를 가져옵니다.

IsSynchronized

개체가 동기화되는지 여부를 나타내는 값을 가져옵니다.

Item[String]

[] 구문을 사용하여 PropertyDataCollection에서 지정된 속성을 가져옵니다. 이 속성은 PropertyDataCollection 클래스의 인덱서입니다.

SyncRoot

동기화에 사용될 개체를 가져옵니다.

메서드

Add(String, CimType, Boolean)

값을 할당하지 않고 새 PropertyData를 추가합니다.

Add(String, Object)

지정한 값의 새 PropertyData를 추가합니다. 이 값은 null일 수 없으며 CIM(Common Information Model) 형식으로 변환될 수 있어야 합니다.

Add(String, Object, CimType)

지정한 값과 CIM(Common Information Model) 형식을 가지는 새 PropertyData를 추가합니다.

CopyTo(Array, Int32)

PropertyDataCollection을 배열에 복사합니다.

CopyTo(PropertyData[], Int32)

PropertyDataCollection을 특수화된 PropertyData 개체 배열에 복사합니다.

Equals(Object)

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

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

PropertyDataCollection에 대한 열거자를 반환합니다.

GetHashCode()

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

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

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

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

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

(다음에서 상속됨 Object)
Remove(String)

PropertyData에서 PropertyDataCollection 개체를 제거합니다.

ToString()

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

(다음에서 상속됨 Object)

명시적 인터페이스 구현

IEnumerable.GetEnumerator()

IEnumerator를 반복하는 PropertyDataCollection를 반환합니다.

확장 메서드

Cast<TResult>(IEnumerable)

IEnumerable의 요소를 지정된 형식으로 캐스팅합니다.

OfType<TResult>(IEnumerable)

지정된 형식에 따라 IEnumerable의 요소를 필터링합니다.

AsParallel(IEnumerable)

쿼리를 병렬화할 수 있도록 합니다.

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상