logo
CSharp_Prog_Guide

Примеры

Visual Studio 2008 устанавливает образцы приложений для Visual Basic, Visual C#, Visual C++ и Visual Studio Team System на локальный жесткий диск. Чтобы получить доступ к образцам в меню Справка щелкните Образцы и затем следуйте инструкциям и ссылкам на странице образцов.

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.

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.