How to write a Visual Studio macro to refactor Extract Class?

I am trying to create a macro for Visual Studio 2008 that behaves like this: (Extract a macro class)

I select the text in the currently open document and call the macro (using key bindings or something else).

The macro starts the project "Project.AddClass" for the currently active project, allowing you to specify the class name.

The macro adds the text that I originally selected in another document to the newly created class file and removes the text from the source file.

The text is added to the new file inside the new class, i.e. inside opening and closing curly braces.

I did this, but I cannot get the handle to the generated class document.

Any help would be greatly appreciated.

+3
source share
1 answer

I just made a macro for this today and found your question, seeing if others did it, although it is a couple of years later, when the answer comes, this is one :)

Updated February 2012. Now the macro project can be found here: http://plisky.net/main/macros/documentation

+3
source

Source: https://habr.com/ru/post/1711233/


All Articles