Type.IsNestedPrivate 속성

Type이 중첩되어 있고 private 형식으로 선언되어 있는지 여부를 나타내는 값을 가져옵니다.

네임스페이스: System
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public ReadOnly Property IsNestedPrivate As Boolean
‘사용 방법
Dim instance As Type
Dim value As Boolean

value = instance.IsNestedPrivate
public bool IsNestedPrivate { get; }
public:
virtual property bool IsNestedPrivate {
    bool get () sealed;
}
/** @property */
public final boolean get_IsNestedPrivate ()
public final function get IsNestedPrivate () : boolean

속성 값

Type이 중첩되어 있고 private 형식으로 선언되어 있으면 true이고, 그렇지 않으면 false입니다.

설명

현재 Type이 제네릭 형식의 형식 매개 변수를 나타내는 경우 이 속성은 언제나 false를 반환합니다.

TypeAttributes.VisibilityMask에서는 표시 특성을 선택합니다.

예제

다음 예제에서는 중첩된 클래스를 private으로 선언하고 중첩된 클래스의 IsNestedPrivate 속성 값을 표시합니다.

Imports System
Imports Microsoft.VisualBasic
' Outer class.
Public Class MyClassA
    ' Private nested class.
    Private Class MyClassB
    End Class 'MyClassB
    Public Shared Sub Main()
        ' Get the type of the nested class.
        Dim myTypeB As Type = GetType(MyClassA.MyClassB)
        ' Get the IsNestedPrivate property of the nested class.
        Console.WriteLine(ControlChars.Cr + "The IsNestedPrivate property value of the nested class is {0}.", myTypeB.IsNestedPrivate.ToString())
    End Sub 'Main
End Class 'MyClassA
using System;
// Outer class.
public class MyClassA
{
    // Private nested class.
    private class MyClassB
    {
    }
    public static void Main(string[] args)
    {   
        // Get the type of the nested class.
        Type myTypeB = typeof(MyClassA.MyClassB);
        // Get the IsNestedPrivate property of the nested class.
        Console.WriteLine("\nThe IsNestedPrivate property value of the nested class is {0}.", myTypeB.IsNestedPrivate.ToString());  
    }
}
using namespace System;

// Outer class.
public ref class MyClassA
{
private:

   // Private nested class.
   ref class MyClassB{};


public:
   static void Test()
   {
      // Get the type of the nested class.
      Type^ myTypeB = MyClassA::MyClassB::typeid;
      
      // Get the IsNestedPrivate property of the nested class.
      Console::WriteLine( "\nThe IsNestedPrivate property value of the nested class is {0}.", myTypeB->IsNestedPrivate );
   }
};

int main()
{
   MyClassA::Test();
}
import System.*;

// Outer class.
public class MyClassA
{
    // Private nested class.
    private class MyClassB
    {
    } //MyClassB

    public static void main(String[] args)
    {
        // Get the type of the nested class.
        Type myTypeB = MyClassA.MyClassB.class.ToType();

        // Get the IsNestedPrivate property of the nested class.
        Console.WriteLine("\nThe IsNestedPrivate property value of the nested"
            +" class is {0}.",
            System.Convert.ToString(myTypeB.get_IsNestedPrivate()));
    } //main
} //MyClassA

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

Type 클래스
Type 멤버
System 네임스페이스
TypeAttributes