Marks each type of member that is defined as a derived class of MemberInfo.
using System;
using System.Reflection;
class membertypesenum
{
public static int Main(string[] args)
{
MemberTypes Mymembertypes;
Type Mytype = Type.GetType("System.Reflection.ReflectionTypeLoadException");
MemberInfo[] Mymembersinfoarray = Mytype.GetMembers();
foreach (MemberInfo Mymemberinfo in Mymembersinfoarray)
{
Mymembertypes = Mymemberinfo.MemberType;
Console.WriteLine("The member {0} of {1} is a {2}.", Mymemberinfo.Name, Mytype, Mymembertypes.ToString());
}
return 0;
}
}
Related examples in the same category