Type.IsNestedFamANDAssem 属性

获取一个值,通过该值指示 Type 是否是嵌套的并且只对同时属于自己家族和自己程序集的类可见。

**命名空间:**System
**程序集:**mscorlib(在 mscorlib.dll 中)

语法

声明
Public ReadOnly Property IsNestedFamANDAssem As Boolean
用法
Dim instance As Type
Dim value As Boolean

value = instance.IsNestedFamANDAssem
public bool IsNestedFamANDAssem { get; }
public:
virtual property bool IsNestedFamANDAssem {
    bool get () sealed;
}
/** @property */
public final boolean get_IsNestedFamANDAssem ()
public final function get IsNestedFamANDAssem () : boolean

属性值

如果 Type 是嵌套的并且只对同时属于它自己的家族和它自己的程序集的类可见,则为 true;否则为 false

备注

如果当前 Type 表示泛型类型的类型形参,则此属性 (Property) 始终返回 false

TypeAttributes.VisibilityMask 选择可见性属性。

Type 对象的家族被定义为具有完全相同的 Type 及其子类型的所有对象。

示例

下面的示例说明 IsNestedFamANDAssem 属性 (Property) 的用法。

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 IsNestedFamANDAssem property of the nested class.
        Console.WriteLine(ControlChars.Cr + "The IsNestedFamANDAssem property value of the nested class is {0}.", myTypeB.IsNestedFamANDAssem.ToString())
    End Sub 'Main
End Class 'MyTestClass
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 IsNestedFamANDAssem property of the nested class.
        Console.WriteLine("\nThe IsNestedFamANDAssem property value of the nested class is {0}.", myTypeB.IsNestedFamANDAssem.ToString()); 
    }
}
using namespace System;

// Enclose a class.
ref class MyClassA
{
public protected:
   ref class MyClassB{};
};

int main()
{
   // Get the type of the nested class.
   Type^ myTypeB = MyClassA::MyClassB::typeid;
   
   // Get the IsNestedFamANDAssem property of the nested class.
   Console::WriteLine( "\nThe IsNestedFamANDAssem property value of the nested class is {0}.", myTypeB->IsNestedFamANDAssem );
}
import System.*;

// Enclose a class.
class MyClassA
{
    protected class MyClassB
    {
    } //MyClassB
} //MyClassA

class MyTestClass
{
    public static void main(String[] args)
    {
        // Get the type of the nested class.
        Type myTypeB = MyClassA.MyClassB.class.ToType();

        // Get the IsNestedFamANDAssem property of the nested class.
        Console.WriteLine("\nThe IsNestedFamANDAssem property value of the"
            +" nested class is {0}.", 
            System.Convert.ToString(myTypeB.get_IsNestedFamANDAssem()));
    } //main
} //MyTestClass

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

.NET Compact Framework

受以下版本支持:2.0、1.0

请参见

参考

Type 类
Type 成员
System 命名空间
TypeAttributes