_PropertyInfo.MemberType プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)
構文
このメンバがプロパティであることを示す MemberTypes 値の 1 つ。
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
PropertyInfo.MemberType プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)
構文
このメンバがプロパティであることを示す MemberTypes 値。
このプロパティは MemberType をオーバーライドします。このため、MemberInfo オブジェクトのセット (GetMembers によって返される配列など) を調べるときに、MemberType プロパティは、指定したメンバがプロパティである場合のみ Property を返します。
MemberType は MemberInfo の派生クラスで、このメンバの型を指定します。メンバ型には、コンストラクタ、プロパティ、フィールド、およびメソッドがあります。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 */
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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- _PropertyInfo.MemberType プロパティのページへのリンク