Type.IsNestedPublic 속성

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

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

구문

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

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

속성 값

클래스가 중첩되어 있고 public 형식으로 선언되어 있으면 true이고, 그렇지 않으면 false입니다.

설명

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

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

예제

다음 예제에서는 public 중첩 클래스를 선언하고 IsNestedPublic 속성 값을 표시합니다.

Imports System
Imports Microsoft.VisualBasic
' Enclose a class.
Public Class MyClassA
    ' Public nested class.
    Public 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 IsNestedPublic property of the nested class.
        Console.WriteLine(ControlChars.Cr + "The IsNestedPublic property value of the nested class is {0}.", myTypeB.IsNestedPublic.ToString())
    End Sub 'Main
End Class 'MyClassA
using System;
// Enclose a class.
public class MyClassA
{
    // Public nested class.
    public class MyClassB
    {
    }
    public static void Main(string[] args)
    {   
        // Get the type of the nested class.
        Type myTypeB = typeof(MyClassA.MyClassB);
        // Get the IsNestedPublic property of the nested class.
        Console.WriteLine("\nThe IsNestedPublic property value of the nested class is {0}.", myTypeB.IsNestedPublic.ToString());            
    }
}
using namespace System;

// Enclose a class.
public ref class MyClassA
{
public:

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

int main()
{
   
   // Get the type of the nested class.
   Type^ myTypeB = MyClassA::MyClassB::typeid;
   
   // Get the IsNestedPublic property of the nested class.
   Console::WriteLine( "\nThe IsNestedPublic property value of the nested class is {0}.", myTypeB->IsNestedPublic.ToString() );
}
import System.*;

// Enclose a class.
public class MyClassA
{
    // Public nested class.
    public class MyClassB
    {
    } //MyClassB

    public static void main(String[] args)
    {
        // Get the type of the nested class.
        Type myTypeB = MyClassA.MyClassB.class.ToType();
        // Get the IsNestedPublic property of the nested class.
        Console.WriteLine("\nThe IsNestedPublic property value of the nested" 
            + " class is {0}.", System.Convert.ToString(
            myTypeB.get_IsNestedPublic()));
    } //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