ConstructorInfo.MemberType プロパティ
インスタンスがリフレクションするメンバの型を指定します。このプロパティは読み取り専用です。
Overrides Public ReadOnly Property MemberType As MemberTypes
[C#]
public override MemberTypes MemberType {get;}
[C++]
public: __property MemberTypes get_MemberType();
[JScript]
public override function get MemberType() : MemberTypes;
プロパティ値
インスタンスがリフレクションする MemberTypes オブジェクト。
使用例
Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic
Class Mymemberinfo
Public Shared Function Main() As Integer
Console.WriteLine(ControlChars.Cr + "Reflection.MemberInfo")
' Get the Type and MemberInfo.
Dim MyType As Type = Type.GetType("System.Reflection.PropertyInfo")
Dim Mymemberinfoarray As MemberInfo() = MyType.GetMembers()
' Get the MemberType method and display the elements.
Console.Write(ControlChars.Cr + "There are {0} members in ", _
Mymemberinfoarray.GetLength(0))
Console.Write("{0}.", MyType.FullName)
Dim counter As Integer
For counter = 0 To Mymemberinfoarray.Length - 1
Console.Write(ControlChars.CrLf + counter.ToString() + ". " _
+ Mymemberinfoarray(counter).Name _
+ " Member type - " _
+ Mymemberinfoarray(counter).MemberType.ToString())
Next counter
Return 0
End Function
End Class
[C#]
using System;
using System.Reflection;
class Mymemberinfo
{
public static int Main()
{
Console.WriteLine ("\nReflection.MemberInfo");
// Get the Type and MemberInfo.
Type MyType = Type.GetType("System.Reflection.PropertyInfo");
MemberInfo[] Mymemberinfoarray = MyType.GetMembers();
// Get the MemberType method and display the elements.
Console.Write("\nThere are {0} members in ", Mymemberinfoarray.GetLength(0));
Console.Write("{0}.", MyType.FullName);
for (int counter = 0; counter < Mymemberinfoarray.Length; counter++)
{
Console.Write("\n" + counter + ". "
+ Mymemberinfoarray[counter].Name
+ " Member type - " +
Mymemberinfoarray[counter].MemberType.ToString());
}
return 0;
}
}
[C++]
#using <mscorlib.dll>
using namespace System;
using namespace System::Reflection;
int main()
{
Console::WriteLine (S"\nReflection.MemberInfo");
// Get the Type and MemberInfo.
Type* MyType = Type::GetType(S"System.Reflection.PropertyInfo");
MemberInfo* Mymemberinfoarray[] = MyType->GetMembers();
// Get the MemberType method and display the elements.
Console::Write(S"\nThere are {0} members in ", __box(Mymemberinfoarray->GetLength(0)));
Console::Write(S"{0}.", MyType->FullName);
for (int counter = 0; counter < Mymemberinfoarray->Length; counter++)
{
Console::Write(S"\n{0}. {1} Member type - {2}",
__box(counter), Mymemberinfoarray[counter]->Name, __box(Mymemberinfoarray[counter]->MemberType));
}
return 0;
}
[JScript]
import System;
import System.Reflection;
class Mymemberinfo
{
public static function Main() : void
{
Console.WriteLine ("\nReflection.MemberInfo");
//Get the Type and MemberInfo.
var MyType : Type = Type.GetType("System.Reflection.PropertyInfo");
var Mymemberinfoarray : MemberInfo[] = MyType.GetMembers();
//Get the MemberType method and display the elements.
Console.Write("\nThere are {0} members in ",
Mymemberinfoarray.GetLength(0));
Console.Write("{0}.", MyType.FullName);
for (var counter : int in Mymemberinfoarray)
{
Console.Write("\n" + counter + ". "
+ Mymemberinfoarray[counter].Name
+ " Member type - " +
Mymemberinfoarray[counter].MemberType.ToString());
}
}
}
Mymemberinfo.Main();
必要条件
プラットフォーム: 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
参照
ConstructorInfo クラス | ConstructorInfo メンバ | System.Reflection 名前空間 | MemberTypes