_FieldInfo.IsFamilyAndAssembly プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > _FieldInfo.IsFamilyAndAssembly プロパティの意味・解説 

_FieldInfo.IsFamilyAndAssembly プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

COM オブジェクトに、IsFamilyAndAssembly プロパティへのバージョン依存しないアクセス用意されています。

このプロパティは、CLS準拠していません。  

名前空間: System.Runtime.InteropServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

ReadOnly Property IsFamilyAndAssembly As
 Boolean
Dim instance As _FieldInfo
Dim value As Boolean

value = instance.IsFamilyAndAssembly
bool IsFamilyAndAssembly { get; }
property bool IsFamilyAndAssembly {
    bool get ();
}
/** @property */
boolean get_IsFamilyAndAssembly ()
function get IsFamilyAndAssembly () : boolean

プロパティ
フィールドFamANDAssem 属性設定されている場合trueそれ以外場合false

解説解説

このプロパティは、アンマネージ コードからマネージ クラスアクセスするためのプロパティであるため、マネージ コードからは呼び出さないください

IsFamilyAndAssembly プロパティは、このフィールドFamilyAndAssembly レベル参照範囲設定されているかどうかを示す値を取得します

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
_FieldInfo インターフェイス
_FieldInfo メンバ
System.Runtime.InteropServices 名前空間

FieldInfo.IsFamilyAndAssembly プロパティ

このフィールドに、FamilyAndAssembly レベル参照可能範囲設定されているかどうかを示す値を取得します

名前空間: System.Reflection
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Dim instance As FieldInfo
Dim value As Boolean

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

プロパティ
フィールドFamANDAssem 属性設定されている場合trueそれ以外場合false

解説解説

フィールドFamilyAndAssembly レベル参照可能範囲設定されている場合、そのフィールドは同じアセンブリ内にある派生クラスすべてのメンバから呼び出せますが、他の型からは呼び出せません。

IsFamilyAndAssembly プロパティは、FieldAttributes.FamANDAssem 属性設定されたときに設定されます。

使用例使用例

クラス作成しクラス名フィールドの値、フィールドIsFamilyAndAssembly プロパティの値を表示する例を次に示します

Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic

Public Class Fieldinfo_IsFamilyAndAssembly
    Protected Friend myField As
 String = "A protected internal field"

    Public Shared Sub Main()
        Dim myObject As New
 Fieldinfo_IsFamilyAndAssembly()
        ' Get the Type and FieldInfo.
        Dim myType1 As Type = GetType(Fieldinfo_IsFamilyAndAssembly)
        Dim myFieldInfo As FieldInfo = myType1.GetField("myField",
 BindingFlags.NonPublic Or BindingFlags.Instance)
        ' Display the class and field name and the FamilyAndAssembly
 property value for the field.
        Console.Write(ControlChars.Lf & " Name of class: {0}",
 myType1.FullName)
        Console.Write(ControlChars.Lf & " Value of field:
 {0}", myFieldInfo.GetValue(myObject))
        Console.Write(ControlChars.Lf & " IsFamilyAndAssembly:
 {0}", myFieldInfo.IsFamilyAndAssembly)
    End Sub 'Main
End Class 'Fieldinfo_IsFamilyAndAssembly
using System;
using System.Reflection;

public class Fieldinfo_IsFamilyAndAssembly
{
    protected internal string myField = "A
 protected internal field";
   
    public static void Main()
    {
        Fieldinfo_IsFamilyAndAssembly myObject = new 
            Fieldinfo_IsFamilyAndAssembly();

        // Get the Type and FieldInfo.
        Type myType1 = typeof(Fieldinfo_IsFamilyAndAssembly);
        FieldInfo myFieldInfo = myType1.GetField("myField",
            BindingFlags.NonPublic|BindingFlags.Instance);

        // Display the class and field name and the FamilyAndAssembly
 property value for the field.
        Console.Write("\n Name of class: {0}", myType1.FullName);
        Console.Write("\n Value of field: {0}", myFieldInfo.GetValue(myObject));
        Console.Write("\n IsFamilyAndAssembly: {0}", 
            myFieldInfo.IsFamilyAndAssembly );
    }
}
using namespace System;
using namespace System::Reflection;

public ref class Fieldinfo_IsFamilyAndAssembly
{
public protected:
   String^ myField;

public:
   Fieldinfo_IsFamilyAndAssembly()
   {
      myField = "A protected internal field";
   }
};

int main()
{
   Fieldinfo_IsFamilyAndAssembly^ myObject = gcnew Fieldinfo_IsFamilyAndAssembly;

   // Get the Type and FieldInfo.
   Type^ myType1 = Fieldinfo_IsFamilyAndAssembly::typeid;
   FieldInfo^ myFieldInfo = myType1->GetField( "myField", static_cast<BindingFlags>(BindingFlags::NonPublic
 | BindingFlags::Instance) );

   // Display the class and field name and the FamilyAndAssembly property
 value for the field.
   Console::Write( "\n Name of class: {0}", myType1->FullName
 );
   Console::Write( "\n Value of field: {0}", myFieldInfo->GetValue(
 myObject ) );
   Console::Write( "\n IsFamilyAndAssembly: {0}", myFieldInfo->IsFamilyAndAssembly
 );
}
import System.*;
import System.Reflection.*;

public class FieldinfoIsFamilyAndAssembly
{
    protected String myField = "A protected
 internal field";

    public static void main(String[]
 args)
    {
        FieldinfoIsFamilyAndAssembly myObject = 
            new FieldinfoIsFamilyAndAssembly();

        // Get the Type and FieldInfo.
        Type myType1 = FieldinfoIsFamilyAndAssembly.class.ToType();
        FieldInfo myFieldInfo = myType1.GetField("myField", 
            BindingFlags.NonPublic | BindingFlags.Instance);

        // Display the class and field name and the FamilyAndAssembly
 property
        // value for the field.
        Console.Write("\n Name of class: {0}", myType1.get_FullName());
        Console.Write("\n Value of field: {0}",
            myFieldInfo.GetValue(myObject));
        Console.Write("\n IsFamilyAndAssembly: {0}",
            (System.Boolean)myFieldInfo.get_IsFamilyAndAssembly());
    } //main
} //FieldinfoIsFamilyAndAssembly
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「_FieldInfo.IsFamilyAndAssembly プロパティ」の関連用語

_FieldInfo.IsFamilyAndAssembly プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



_FieldInfo.IsFamilyAndAssembly プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS