问题
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