代码生成的包装类 [英] Code Generator for wrapper classes

查看:126
本文介绍了代码生成的包装类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你知道吗,产生基于另一个类包装类工具

Do you know of a tool that generates wrapper class based on another class?

编辑:?通过包装类我的意思是它包装所有暴露一个类(公共,受保护)属性方法事件,这样你可以把任何逻辑在中间。我的具体目的是用它来验证封装类的行为。

By wrapper class I mean a class which wraps all exposed(public, protected) properties methods events so that you can put any logic in the middle. My concrete purpose is use it to verify the behavior of the wrapped class.

推荐答案

您可以使用T4模板写你自己的逻辑...

You could use T4 templating and write your own logic...

HTTP ://msdn.microsoft.com/en-us/library/bb126445.aspx
http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisu​​alStudioSecret.aspx

http://msdn.microsoft.com/en-us/library/bb126445.aspx http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx

这篇关于代码生成的包装类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆