在 non-static 的情況下, C# 容許由 string 取得目標 class type.
呼叫方式如下
function xxxSomeMethodxxx(){
// for example following are the same.
}
// case 1
typeof(xxxSomeMethodxxx);
// case 2
System.Type _type = this.GetType().Assembly.GetType("xxxSomeMethodxxx");
原因是 this.GetType().Assembly 是取得 compile 後的目標, 由此可以再呼叫 GetType 取得其他的 Method. 此方法於 static 物件不適用.
只是路過,看見你的blog,很好。打個招呼。