12 Eyl 2011

Reflection ile Execute Edilen Metod'un Namespace, Class Adı, ve Metod adını alma

protected string CurrentName
  {
    get
    {
      StackTrace st = new StackTrace(true);
      MethodBase mb = st.GetFrame(1).GetMethod();
      return mb.ReflectedType.Namespace + "." + mb.ReflectedType.Name + "." + mb.Name;
    }
  }

Hiç yorum yok:

Yorum Gönder