C# Type IsNestedFamORAssem

Description

Type IsNestedFamORAssem gets a value indicating whether the Type is nested and visible only to classes that belong to either its own family or to its own assembly.

Syntax

Type.IsNestedFamORAssem has the following syntax.


public bool IsNestedFamORAssem { get; }

Example

The following example declares a nested class with visibility in its own family or in its own assembly and displays IsNestedFamORAssem property value of the nested class.


using System;/* w  w w  .  j a v  a 2s  . c  om*/
// Enclose a class. 
class MyClassA
{
    protected internal class MyClassB
    {
    }
}
class MyTestClass 
{
    public static void Main(string[] args)
    {        
        Type myTypeB = typeof(MyClassA.MyClassB);
        Console.WriteLine(myTypeB.IsNestedFamANDAssem.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