using System;
using System.ComponentModel;
//csc reflection_typeof_getmembers1.cs
using System.Reflection;
namespace ConsoleApplication1
{
class A
{
private int n1; private double D1;
public A() { Console.WriteLine("constructor"); }
~A() { Console.WriteLine("desstructor"); }
public void method(int n1, double d1)
{
Console.WriteLine("Console Write" );
this.n1 = n1;
this.D1 = d1;
}
}
class MainClass
{
public static void Main(string[] args)
{
MemberInfo[] m1 = typeof(A).GetMembers();
A a = new A();
a.method(12, 12.45);
int i = 0;
foreach (MemberInfo m in m1)
{
Console.WriteLine(i + " info "+ m +" | declartion |" +
m.DeclaringType);
i++;
}
Console.ReadLine();
}
}
}