将属性添加到ExpandObject成员var?

时间:2012-06-11 10:52:54

标签: c#

我找到了这个话题,它谈了一下:Is it possible to add attributes to the generated members of an ExpandoObject instance?

但似乎只关注powergrid。

我花了大约1个小时在谷歌上寻找这个没有任何运气。任何人都可以至少确认是否可以做到吗?。

1 个答案:

答案 0 :(得分:2)

您可以创建一个界面并将属性添加到界面。

比使用Improptu:http://code.google.com/p/impromptu-interface/

IMyInterface instance = Impromptu.ActLike<IMyInferface>(myexpando);