Using the Class Designer to Refactor

The class designer enables you to view the contents of your classes and their relationships. It can also be used as a productivity tool: you can create new classes and modify existing ones directly within the designer.


Note

The class designer is covered in Chapter 6, “Introducing the Editors and Designers.”


The class designer also supports refactoring. For example, you can rename elements within your classes or change their signature and the operation will use the compiler to update references accordingly. Figure 9.5 shows renaming a class directly within the diagram. Hitting enter after this rename will update references.

Image

FIGURE 9.5 Refactoring within the Visual Studio class designer.


Note

In the current build at time of writing (2015 RC), the Visual Studio class designer exposes the refactoring tool as a context menu from items within the class. However, the items in the menu are currently not implemented and throw an error. Microsoft may fix this in future builds. That said, refactoring by just editing the items in the diagram is very much operational.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset