有沒有一種方法可以告訴對象是否分配了類型,是動態類型?在動態類型上反映它是否是動態類型,開始於
例如:
dynamic foo = GetCat();
Console.WriteLine((foo is Cat).ToString()); // will print True because
// at the execution time, foo will have assumed the Cat type. However, is
// there a mechanism by which I can reflect on foo and say, "This guy was assigned
// a dynamic type, to begin with."?
我認爲這是不可能的,但由於我不完全確定,我只是拭目以待,看看有什麼答案進來:); – Lucero 2010-05-21 16:24:44
出於好奇,你爲什麼想知道? – 2010-05-21 17:09:55
嗨,Eric,我以爲你的評論是針對Lucero的。但我現在懷疑這是針對我原來的問題。我已經在您的官方電子郵件地址發送了一封私人電子郵件,附有您的問題的答案。 – 2010-05-22 21:57:05