Is there a tool to merge partial classes into one non-partial class?
I cannot use Reflector, since I need variable names, etc. to match.
EDIT:
I have hundreds of partial classes I want to merge, so cut-paste is not realistic.
Is there a tool to merge partial classes into one non-partial class?
I cannot use Reflector, since I need variable names, etc. to match.
EDIT:
I have hundreds of partial classes I want to merge, so cut-paste is not realistic.
Resharper has a "Copy Type" feature that allows to copy all parts of a type into a single file: http://www.jetbrains.com/resharper/documentation/reviewers_guide.html#refactorings
There is a manual effort involved, though, since you have to open at least one file for each file and invoke the functionality.
I know someone else has mentioned using ReSharper, I'm using ReSharper 6.1, and if I click on the partial
keyword in a partial class file, and hit ALT+ENTER it gives an option 'Merge partial declarations'.
I think if it's quite a complicated class it struggles to do this though. But I tested it on a simpler version with two different files and one partial class defined in both with different properties, and it managed to merge them fine.
Edit: A custom tool that does this, I'm not sure of. Sorry if this doesn't answer your original question (only noticed you can't use Reflector now, so I assume ReSharper is also out of the question).
Edit -> Copy -> Paste.
Don't know any other simplier tool for this.
Just copy the code from one file to the other, remove the first file and the partial keyword from the other.
If you have hundreds of partial classes, it should be easy enough to make a bot to do just that, only x100 times.