Type.IsNestedFamORAssem Property
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.
[Visual Basic] Public ReadOnly Property IsNestedFamORAssem As Boolean [C#] public bool IsNestedFamORAssem {get;} [C++] public: __property bool get_IsNestedFamORAssem(); [JScript] public function get IsNestedFamORAssem() : Boolean;
Property Value
true if the Type is nested and visible only to classes that belong to its own family or to its own assembly; otherwise, false.
Remarks
The VisibilityMask selects the visibility attributes.
A Type object's family is defined as all objects of the exact same Type and of its subtypes.
Example
[Visual Basic, C#, C++] 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.
[Visual Basic] Imports System Imports Microsoft.VisualBasic ' Enclose a class. Class MyClassA ' Protected friend nested class. Protected Friend Class MyClassB End Class 'MyClassB End Class 'MyClassA Class MyTestClass Public Shared Sub Main() ' Get the type of the nested class. Dim myTypeB As Type = GetType(MyClassA.MyClassB) ' Get the IsNestedFamORAssem property of the nested class. Console.WriteLine(ControlChars.Cr + "The IsNestedFamORAssem property value of the nested class is {0}.", myTypeB.IsNestedFamORAssem.ToString()) End Sub 'Main End Class 'MyTestClass [C#] using System; // Enclose a class. class MyClassA { protected internal class MyClassB { } } class MyTestClass { public static void Main(string[] args) { // Get the type of the nested class. Type myTypeB = typeof(MyClassA.MyClassB); // Get the IsNestedFamORAssem property of the nested class. Console.WriteLine("\nThe IsNestedFamORAssem property value of the nested class is {0}.", myTypeB.IsNestedFamANDAssem.ToString()); } } [C++] #using <mscorlib.dll> using namespace System; // Enclose a class. __gc class MyClassA { protected public: __gc class MyClassB { }; }; int main() { // Get the type of the nested class. Type* myTypeB = __typeof(MyClassA::MyClassB); // Get the IsNestedFamORAssem property of the nested class. Console::WriteLine(S"\nThe IsNestedFamORAssem property value of the nested class is {0}.", __box( myTypeB->IsNestedFamORAssem)); }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard
See Also
Type Class | Type Members | System Namespace | TypeAttributes