I'm trying to automate the generation and cleanup of partial classes created using the .net framework's XSD too. My main problem is that [System.Diagnostics.DebuggerStepThroughAttribute()] affects the code in my partial class as well as the automatically generated one. I can delete the offending attribute in the same batch file that I use to create the files.
However I don't want to be stepping into all of the autogenerated file's properties. I can stop the debugger from entering each property by applying [System.Diagnostics.DebuggerStepThrough()] to the get and set methods. Can I do this via a batch file? without needing to install/configure a third party scripting language to do the text processing?
Example property with attributes added:
public string FileFormatVersion
{
[System.Diagnostics.DebuggerStepThrough()]
get {
return this.fileFormatVersionField;
}
[System.Diagnostics.DebuggerStepThrough()]
set
{
this.fileFormatVersionField = value;
}
}
Link to deleting lines via a batch file (first part of the needed cleanup) http://stackoverflow.com/questions/418916/delete-certain-lines-in-a-txt-file-via-a-batch-file