次の方法で共有


Type.IsNestedFamORAssem プロパティ

Type が入れ子になっていて、それ自体が属するファミリまたはアセンブリのいずれかに属しているクラスだけから参照可能かどうかを示す値を取得します。

Public ReadOnly Property IsNestedFamORAssem As Boolean
[C#]
public bool IsNestedFamORAssem {get;}
[C++]
public: __property bool get_IsNestedFamORAssem();
[JScript]
public function get IsNestedFamORAssem() : Boolean;

プロパティ値

Type が入れ子になっていて、それ自体が属するファミリまたはアセンブリのいずれかに属しているクラスだけから参照可能な場合は true 。それ以外の場合は false

解説

VisibilityMask は、参照可能範囲属性を選択します。

Type オブジェクトのファミリは、まったく同じ Type とその内部処理形式のすべてのオブジェクトとして定義されています。

使用例

[Visual Basic, C#, C++] 自身のファミリ内かアセンブリ内で参照できる入れ子になったクラスを宣言し、その入れ子になったクラスの IsNestedFamORAssem プロパティ値を表示する例を次に示します。

 
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] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET, Common Language Infrastructure (CLI) Standard

参照

Type クラス | Type メンバ | System 名前空間 | TypeAttributes