Code Generator for wrapper classes

ぃ、小莉子 提交于 2019-12-20 03:13:08

问题


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

EDIT: 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.


回答1:


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

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




回答2:


I have used SmartCode it's flexible and customizable http://www.codeproject.com/KB/dotnet/SmartCode-Code_Generation.aspx




回答3:


Try wrappergen http://sourceforge.net/projects/wrappergen/.

I could not launch the exe, I got an error but you might.



来源:https://stackoverflow.com/questions/3564181/code-generator-for-wrapper-classes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!