MemberInfo.DeclaringType : MemberInfo « System.Reflection « C# / C Sharp by API






MemberInfo.DeclaringType

  

using System;
using System.Text;
using System.Windows.Forms;
using System.Reflection;

class MainClass {
    static void Main() {
        Type t = typeof(double);
        Console.WriteLine("Type Name:  " + t.Name);
        Console.WriteLine("Full Name:  " + t.FullName);
        Console.WriteLine("Namespace:  " + t.Namespace);
        Type tBase = t.BaseType;
        if (tBase != null)
            Console.WriteLine("Base Type:" + tBase.Name);
        Type tUnderlyingSystem = t.UnderlyingSystemType;
        if (tUnderlyingSystem != null)
            Console.WriteLine("UnderlyingSystem Type:" + tUnderlyingSystem.Name);

        Console.WriteLine("\nPUBLIC MEMBERS:");
        MemberInfo[] Members = t.GetMembers();
        foreach (MemberInfo NextMember in Members) {
            Console.WriteLine(NextMember.DeclaringType + " " + NextMember.MemberType + " " + NextMember.Name);
        }
    }
}

   
    
  








Related examples in the same category

1.MemberInfo.GetCustomAttributes
2.MemberInfo.MemberType
3.MemberInfo.Name