Type.IsNestedPublic プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)



入れ子になったパブリック クラスを宣言し、その 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


_Type.IsNestedPublic プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

クラスが入れ子になっていて、パブリックとして宣言されている場合は true。それ以外の場合は false。

このプロパティは、アンマネージ コードからマネージ クラスにアクセスするためのプロパティであるため、マネージ コードからは呼び出さないでください。
Type.IsNestedPublic プロパティは、クラスが入れ子になっていて、パブリックとして宣言されているかどうかを示す値を取得します。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Type.IsNestedPublicのページへのリンク