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


IsNested プロパティは、すべての入れ子にされた型に対して true を返します。可視性は関係ありません。入れ子および参照範囲を同時にテストするには、関連するプロパティ IsNestedAssembly、IsNestedFamily、IsNestedFamANDAssem、IsNestedFamORAssem、IsNestedPrivate、または IsNestedPublic を使用します。
![]() |
---|

入れ子になったプロテクト クラスおよび入れ子になったパブリック クラスの両方に対して、IsNested プロパティの値を表示するコード例を次に示します。
Imports System Public Class Example Protected Class NestedProtected End Class Public Class NestedPublic End Class Public Shared Sub Main() With GetType(NestedProtected) Console.WriteLine("Is " & .FullName & " nested? " & .IsNested) End With With GetType(NestedPublic) Console.WriteLine("Is " & .FullName & " nested? " & .IsNested) End With End Sub End Class ' This example produces the following output: ' 'Is Example+NestedProtected nested? True 'Is Example+NestedPublic nested? True
using System; public class Example { protected class NestedProtected { } public class NestedPublic { } public static void Main() { Type t = typeof(NestedProtected); Console.WriteLine("Is {0} nested? {1}", t.FullName, t.IsNested); t = typeof(NestedPublic); Console.WriteLine("Is {0} nested? {1}", t.FullName, t.IsNested); } } /* This example produces the following output: Is Example+NestedProtected nested? True Is Example+NestedPublic nested? True */
using namespace System; public ref class Example { protected: ref class NestedProtected{}; public: ref class NestedPublic{}; static void Main() { Type^ t = NestedProtected::typeid; Console::WriteLine( L"Is {0} nested? {1}", t->FullName, t->IsNested ); t = NestedPublic::typeid; Console::WriteLine( L"Is {0} nested? {1}", t->FullName, t->IsNested ); } }; int main() { Example::Main(); } /* This example produces the following output: Is Example+NestedProtected nested? True Is Example+NestedPublic nested? True */
import System.*; public class Example { protected class NestedProtected { } //NestedProtected public class NestedPublic { } //NestedPublic public static void main(String[] args) { Type t = NestedProtected.class.ToType(); Console.WriteLine("Is {0} nested? {1}", t.get_FullName(), (System.Boolean)t.get_IsNested()); t = NestedPublic.class.ToType(); Console.WriteLine("Is {0} nested? {1}", t.get_FullName(), (System.Boolean)t.get_IsNested()); } //main } //Example /* This example produces the following output: Is Example+NestedProtected nested? True Is Example+NestedPublic nested? True */

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からType.IsNested プロパティを検索する場合は、下記のリンクをクリックしてください。

- Type.IsNested プロパティのページへのリンク