Enabling the Class Designer

To enable the Visual Studio Class Designer, you need to click the View Class Diagram button in Solution Explorer. When ready, the Class Designer appears as a new window within the IDE and shows a graphical representation of the main application module, including the definition of the Main method. Basically all tasks you can perform on the Class Designer can be accomplished by invoking commands exposed by the context menu that you get when right-clicking the designer’s surface. Figure 17.1 shows the previously mentioned representation of Module1 and the available commands.

Figure 17.1 The Visual Studio Class Designer when launched plus available commands for design operations.

image

Figure 17.1 also shows the Add command expanded; it provides a list of available objects that you can add to the diagram. Such objects include classes, enumerations, interfaces, structures, delegates, and modules. You can also select the Comment command to add sticky notes on the designer’s surface. Table 17.1 summarizes the goal of other commands in the context menu.

Table 17.1 Commands List for the Class Designer

image

Class Diagrams Files

Class diagrams generated with the Visual Studio Class Designer are stored within a .cd file that becomes part of the solution. By default, the file is named ClassDiagram1.cd, but you can rename it as you like via Solution Explorer.

At this point it’s time to use the Class Designer. Your goal is to design an IPerson interface that an abstract class named Person can implement and that will also is the base class for two other derived classes, Customer and Contact, both created with this interesting graphical tool.

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

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