thersch
thersch

Reputation: 1396

Move class into another class by ReSharper

I have a non-nested class WillBeNestedClass and another class NestBox.
Now I want to move class WillBeNestedClass into class NestBox as a nested class. So WillBeNestedClass will be nested in class NestBox.

Is there a refactoring in VS or ReSharper that can do that moving and that automatically updates all references to nested class (from WillBeNestedClass to NestBox.WillBeNestedClass)?

Upvotes: 4

Views: 778

Answers (1)

J. Steen
J. Steen

Reputation: 15578

As far as I'm aware, there is no such quick-action or refactoring available in ReSharper by default. Maybe there is some plugin that allows this - or you could try and create your own. I'm sure it'd be appreciated by more developers.

Available out of the box are:

  • Move to folder
  • Move to namespace
  • Move to separate file

I did, as you, attempt to use Move to namespace and input a type but that dog wouldn't fly.

Upvotes: 4

Related Questions