C# Type IsNestedFamily

Description

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

Syntax

Type.IsNestedFamily has the following syntax.


public bool IsNestedFamily { get; }

Example

The following code example demonstrates how to use the IsNestedFamily property to determine whether a type is both nested and protected.


using System;//from   ww w. j av  a2  s.c  o m
class MyClassA
{
   protected class MyClassB
   {
   }   
}
class MyTestClass : MyClassA
{
   public static void Main(string[] args)
   {  
      Type myTypeB = typeof(MyClassA.MyClassB);
      Console.WriteLine(myTypeB.IsNestedFamily.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