idynamicobject

How do you implement C#4's IDynamicObject interface?

半城伤御伤魂 提交于 2019-12-18 13:34:28
问题 To implement "method-missing"-semantics and such in C# 4.0, you have to implement IDynamicObject: public interface IDynamicObject { MetaObject GetMetaObject(Expression parameter); } As far as I can figure out IDynamicObject is actually part of the DLR, so it is not new. But I have not been able to find much documentation on it. There are some very simple example implementations out there (f.x. here and here), but could anyone point me to more complete implementations or some real

How do you implement C#4's IDynamicObject interface?

≡放荡痞女 提交于 2019-11-30 09:41:31
To implement "method-missing"-semantics and such in C# 4.0, you have to implement IDynamicObject: public interface IDynamicObject { MetaObject GetMetaObject(Expression parameter); } As far as I can figure out IDynamicObject is actually part of the DLR, so it is not new. But I have not been able to find much documentation on it. There are some very simple example implementations out there (f.x. here and here ), but could anyone point me to more complete implementations or some real documentation? Especially, how exactly are you supposed to handle the "parameter"-parameter? The short answer is