C# Type IsNestedPublic
Description
Type IsNestedPublic
gets a value indicating whether
a class is nested and declared public.
Syntax
Type.IsNestedPublic
has the following syntax.
public bool IsNestedPublic { get; }
Example
The following example declares a public nested class and displays its IsNestedPublic property value.
/*from w w w . j a v a 2 s . com*/
using System;
// Enclose a class.
public class MyClassA
{
// Public nested class.
public class MyClassB
{
}
public static void Main(string[] args)
{
Type myTypeB = typeof(MyClassA.MyClassB);
Console.WriteLine(myTypeB.IsNestedPublic.ToString());
}
}
The code above generates the following result.