Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Ruft einen Wert ab, der angibt, ob Type geschachtelt und nur innerhalb der eigenen Assembly sichtbar ist.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public ReadOnly Property IsNestedAssembly As Boolean
'Usage
Dim instance As Type
Dim value As Boolean
value = instance.IsNestedAssembly
public bool IsNestedAssembly { get; }
public:
virtual property bool IsNestedAssembly {
bool get () sealed;
}
/** @property */
public final boolean get_IsNestedAssembly ()
public final function get IsNestedAssembly () : boolean
Eigenschaftenwert
true, wenn Type geschachtelt und nur innerhalb der eigenen Assembly sichtbar ist, andernfalls false.
Hinweise
Wenn der aktuelle Type einen Typparameter eines generischen Typs darstellt, gibt diese Eigenschaft immer false zurück.
Die Sichtbarkeitsattribute werden mit TypeAttributes.VisibilityMask ausgewählt.
Beispiel
Im folgenden Beispiel wird eine geschachtelte Klasse mit Sichtbarkeit in der eigenen Assembly deklariert, und ihr IsNestedAssembly-Eigenschaftenwert wird angezeigt.
Imports System
Imports Microsoft.VisualBasic
' Nest a class.
Class MyClassA
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 IsNestedAssembly property of the nested class.
Console.WriteLine(ControlChars.Cr + "The IsNestedAssembly property value of MyClassB is {0}.", myTypeB.IsNestedAssembly.ToString())
End Sub 'Main
End Class 'MyTestClass
using System;
// Nest a class.
class MyClassA
{
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 IsNestedAssembly property of the nested class.
Console.WriteLine("\nThe IsNestedAssembly property value of MyClassB is {0}.", myTypeB.IsNestedAssembly.ToString());
}
}
using namespace System;
// Nest a class.
ref class MyClassA
{
internal:
ref class MyClassB{};
};
int main()
{
// Get the type of the nested class.
Type^ myTypeB = MyClassA::MyClassB::typeid;
// Get the IsNestedAssembly property of the nested class.
Console::WriteLine( "\nThe IsNestedAssembly property value of MyClassB is {0}.", myTypeB->IsNestedAssembly );
}
import System.*;
// Nest a class.
class MyClassA
{
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 IsNestedAssembly property of the nested class.
Console.WriteLine("\nThe IsNestedAssembly property value of "
+"MyClassB is {0}.",System.Convert.ToString(
myTypeB.get_IsNestedAssembly()));
} //main
} //MyTestClass
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
.NET Compact Framework
Unterstützt in: 2.0, 1.0