Splitting Auto Generated Code File into individual class files
I have a large code file generated by XSD.exe, which has generated a 40k file, with many hundreds of class definitions in it. This is because there are about 30 Root XSD's and a few common ones, and they all need to be bundled together to import.
I'd like to split them into seperate classe files so they can be managed easily. Is there any easy way to do this, or am I going to have to resort so some kind 开发者_如何学Cof Regex Voodoo?
Cheers
Tristan
You could use ReSharper to do this:
Right-Click on the generated File --> Refactor --> Move Types into matching Files
If you dont have ReSharper, you could retrieve an evaluation copy at http://www.jetbrains.com/resharper/
regards, Chris
If they're generated as public partial class ClassName
you can create another public partial class ClassName
wherever you like to add additional members.
With most of these autogenerating-class-tools they dump them all in one file because you typically don't want to edit these classes since if the tool is ran again it will overwrite your changes.
If you can generate partial classes with the tool then you should be good to go.
精彩评论