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

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

_PropertyInfo.MemberType プロパティ

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

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

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

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

ReadOnly Property MemberType As
 MemberTypes
Dim instance As _PropertyInfo
Dim value As MemberTypes

value = instance.MemberType
MemberTypes MemberType { get; }
property MemberTypes MemberType {
    MemberTypes get ();
}
/** @property */
MemberTypes get_MemberType ()
function get MemberType () : MemberTypes

プロパティ
このメンバプロパティであることを示す MemberTypes 値の 1 つ

解説解説

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

MemberType プロパティは、このメンバプロパティであることを示す MemberTypes 値を取得します

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

PropertyInfo.MemberType プロパティ

このメンバプロパティであることを示す MemberTypes 値を取得します

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

Public Overrides ReadOnly
 Property MemberType As MemberTypes
Dim instance As PropertyInfo
Dim value As MemberTypes

value = instance.MemberType
public override MemberTypes MemberType { get;
 }
public:
virtual property MemberTypes MemberType {
    MemberTypes get () override;
}
/** @property */
public MemberTypes get_MemberType ()
public override function get
 MemberType () : MemberTypes

プロパティ
このメンバプロパティであることを示す MemberTypes 値。

解説解説

このプロパティは MemberType をオーバーライドます。このため、MemberInfo オブジェクトセット (GetMembers によって返される配列など) を調べるときに、MemberType プロパティは、指定したメンバプロパティである場合のみ Property返します

MemberTypeMemberInfo派生クラスで、このメンバの型を指定しますメンバ型には、コンストラクタプロパティフィールド、およびメソッドありますPropertyInfo プロパティであるため、戻り値の型はプロパティです。

MemberType プロパティ取得するには、最初に Type クラス取得します。そして、その Type から PropertyInfo取得します最後にPropertyInfo から MemberType取得します

使用例使用例

指定したメンバの型を表示する例を次に示します

Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic

Class Mypropertyinfo

    Public Shared Function
 Main() As Integer
        Console.WriteLine(ControlChars.CrLf & "Reflection.PropertyInfo")

        ' Get the type and PropertyInfo.
        Dim MyType As Type = Type.GetType("System.Reflection.MemberInfo")
        Dim Mypropertyinfo As PropertyInfo
 = MyType.GetProperty("Name")

        ' Read and display the MemberType property.
        Console.WriteLine("MemberType = " & _
           Mypropertyinfo.MemberType.ToString())

        Return 0
    End Function
End Class
using System;
using System.Reflection;
 
class Mypropertyinfo
{
    public static int Main()
    {
        Console.WriteLine("\nReflection.PropertyInfo");
  
        // Get the type and PropertyInfo.
        Type MyType = Type.GetType("System.Reflection.MemberInfo");
        PropertyInfo Mypropertyinfo = MyType.GetProperty("Name");
  
        // Read and display the MemberType property.
        Console.Write("\nMemberType = " + Mypropertyinfo.MemberType.ToString());
  
        return 0;
    }
}
using namespace System;
using namespace System::Reflection;
int main()
{
   Console::WriteLine( "\nReflection.PropertyInfo" );
   
   // Get the type and PropertyInfo.
   Type^ MyType = Type::GetType( "System.Reflection.MemberInfo" );
   PropertyInfo^ Mypropertyinfo = MyType->GetProperty( "Name" );
   
   // Read and display the MemberType property.
   Console::Write( "\nMemberType = {0}", Mypropertyinfo->MemberType
 );
   return 0;
}

import System.*;
import System.Reflection.*;

class MyPropertyInfo
{   
    public static void main(String[]
 args)
    {
        Console.WriteLine("\nReflection.PropertyInfo");

        // Get the type and PropertyInfo.
        Type myType = Type.GetType("System.Reflection.MemberInfo");
        PropertyInfo myPropertyInfo = myType.GetProperty("Name");

        // Read and display the MemberType property.
        Console.Write(("\nMemberType = " 
            + myPropertyInfo.get_MemberType().ToString()));
    } //main
} //MyPropertyInfo
import System;
import System.Reflection;

class Mypropertyinfo
{
   public static function
 Main() : void
   {
      Console.WriteLine("\nReflection.PropertyInfo");
 
      //Get the type and PropertyInfo
      var MyType : Type = Type.GetType("System.Reflection.MemberInfo");
      var Mypropertyinfo : PropertyInfo = MyType.GetProperty("Name");
 
      //Read and display the MemberType property
      Console.Write("\nMemberType = " + Mypropertyinfo.MemberType.ToString());
   }
}
Mypropertyinfo.Main();
/*
Produces the following output

Reflection.PropertyInfo
MemberType = Property
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「_PropertyInfo.MemberType プロパティ」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS