C# Type IsNestedAssembly

Description

Type IsNestedAssembly gets a value indicating whether the Type is nested and visible only within its own assembly.

Syntax

Type.IsNestedAssembly has the following syntax.


public bool IsNestedAssembly { get; }

Example

The following example declares a nested class with visibility in its own assembly, and displays its IsNestedAssembly property value.


using System;/*from   w ww  . j  a v  a  2 s. c  o m*/
// Nest a class. 
class MyClassA
{
    internal class MyClassB
    {
    }
}
class MyTestClass
{
    public static void Main(string[] args)
    {  
        Type myTypeB = typeof(MyClassA.MyClassB);
        Console.WriteLine(myTypeB.IsNestedAssembly.ToString());
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version