C# TypeInfo IsNestedFamily

Description

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

Syntax

TypeInfo.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;/*ww w  . ja v a  2  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.Reflection »




EventInfo
FieldInfo
MemberInfo
MethodInfo
ParameterInfo
TypeInfo