EnumerationOptions.EnumerateDeep 속성

정의

지정된 슈퍼 클래스에서 파생된 모든 클래스에 재귀 열거가 요청되는지 여부를 나타내는 값을 가져오거나 설정합니다. 이 경우 false즉시 파생 클래스 멤버만 반환됩니다.

public:
 property bool EnumerateDeep { bool get(); void set(bool value); };
public bool EnumerateDeep { get; set; }
member this.EnumerateDeep : bool with get, set
Public Property EnumerateDeep As Boolean

속성 값

지정된 슈퍼클래스에서 파생된 모든 클래스에 재귀 열거형이 요청되면

예제

다음 예제에서는 생성자를 사용하여 변수를 EnumerationOptionsEnumerationOptions 초기화한 다음 WMI 클래스 및 해당 서브클래스의 모든 인스턴스를 가져옵니다.

using System;
using System.Management;
public class RemoteConnect
{
    public static void Main()
    {
        EnumerationOptions opt = new EnumerationOptions();

        // Will enumerate instances of the given class
        // and any subclasses.
        opt.EnumerateDeep = true;
        ManagementClass c = new ManagementClass("CIM_Service");
        foreach (ManagementObject o in c.GetInstances(opt))
            Console.WriteLine(o["Name"]);
    }
}
Imports System.Management
Public Class RemoteConnect

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

        Dim opt As New EnumerationOptions

        ' Will enumerate instances of the given class
        ' and any subclasses.
        opt.EnumerateDeep = True
        Dim mngmtClass As New ManagementClass("CIM_Service")
        Dim o As ManagementObject
        For Each o In mngmtClass.GetInstances(opt)
            Console.WriteLine(o("Name"))
        Next o

        Return 0
    End Function
End Class

설명

속성 값

지정된 슈퍼클래스에서 파생된 모든 클래스에 재귀 열거형이 요청되면 기본값은 false입니다.

.NET Framework 보안

즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.

적용 대상