I have a couple of properties and I want to collect them under a class to make my code more clean.
Can I do this quickly with ReSharper?
than开发者_高级运维ks
Move Static Member is Ctrl +R, O
in ReSharper. They have a printable keymap which is also helpful before you learn them all (I still haven't...) You can find it here.
Nick Craver is right about the command being there, but I don't think you can ues it on a property unless it is a static property. The option is not available for normal properties for me. What you can do is first convert it to a static property, then move it, then convert it back to being non-static?
It could at least be a first step..
jamiebarrow is correct, you need to refactor to a static type first, see here:
http://www.jetbrains.com/resharper/webhelp/Refactorings__Move__Type_to_Another_Type.html
Yes, I believe that's one of the standard refactorings built into ReSparper and IntelliJ.
This one is quite tricky.
- Put the cursor above the field you want to move
- Press
Ctrl+R O
精彩评论