Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual C#
Refactoring

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual C# Application Development 
Refactoring 

Refactoring is the process of improving your code after it has been written by changing the internal structure of the code without changing the external behavior of the code.

Visual C# provides the following refactoring commands on the Refactoring menu:

Multi-Project Refactoring

Visual Studio supports multi-project refactoring. All of the refactoring operations that correct references across files correct those references across all projects of the same language. This works for any project-to-project references. For example, if you have a console application that references a class library, when you rename a class library type (using the Rename refactoring operation), the references to the class library type in the console application are also updated.

Preview Changes Dialog Box

Many refactoring operations provide an opportunity for you to review all the reference changes that a refactoring operation would perform on your code, before committing to those changes. For these refactoring operations, a preview reference changes option will appear in the refactoring dialog box. After selecting that option and accepting the refactoring operation, the Preview Changes Dialog Box will appear. Notice that the Preview Changes dialog box has two views. The bottom view will display your code with all the reference updates due to the refactoring operation. Pressing Cancel on the Preview Changes dialog box will stop the refactoring operation, and no changes will be made to your code.

Error-Tolerant Refactoring

Refactoring is error tolerant. In other words, you can perform a refactoring in a project that cannot build. However, in these cases the refactoring process might not update ambiguous references correctly.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker