using System;
using System.Reflection;

namespace ConsoleApplication1
{
  public static class Program
  {
    static void Main()
    {
      var assembly = Assembly.GetExecutingAssembly();
      Type type = assembly.GetType("ConsoleApplication1.ReflectionClass");
      if (type != null)
      {
        object classInstance = Activator.CreateInstance(type, null);

        for (int i = 1; i <= 3; i++)
        {
          MethodInfo methodInfo = type.GetMethod(string.Format("ReflectionMethod{0}", i));
          if (methodInfo != null)
            Console.WriteLine(methodInfo.Invoke(classInstance, null));

          PropertyInfo propertyInfo = type.GetProperty(string.Format("ReflectionProperty{0}", i));
          if (propertyInfo != null)
            Console.WriteLine(propertyInfo.GetValue(classInstance, null));
        }
      }
    }
  }

  public class ReflectionClass
  {
    public int ReflectionProperty1
    {
      get { return 1; }
    }

    public int ReflectionProperty2
    {
      get { return 2; }
    }

    public int ReflectionProperty3
    {
      get { return 3; }
    } 

    public int ReflectionMethod1()
    {
      return 1;
    }

    public int ReflectionMethod2()
    {
      return 2;
    }

    public int ReflectionMethod3()
    {
      return 3;
    }
  }
}
