18.2. Design Surface

The design surface of the Class Designer enables the developer to interact with types using a drag-and-drop-style interface. Existing types can be added to the design surface by dragging them from either the class view or the Solution Explorer. If a file in the Solution Explorer contains more than one type, they are all added to the design surface.

Figure 18-2 shows a simple class diagram that contains two classes, Customer and Order, and an enumeration, OrderStatus. Each class contains fields, properties, methods, and events. There is an association between the classes, as a Customer class contains a property called Orders that is a list of Order objects, and the Order class implements the IDataErrorInfo interface. All this information is visible from this class diagram.

Figure 18.2. Figure 18-2

Each class appears as an entity on the class diagram, which can be dragged around the design surface and resized as required. A class is made up of fields, properties, methods, and events. In Figure 18-2, these components are grouped into compartments. Alternative layouts can be selected for the class diagram, which lists the components in alphabetical order or groups the components by accessibility.

The Class Designer is often used to view multiple classes to get an understanding of how they are associated. In this case, it is convenient to hide the components of ...

Get Professional Visual Studio® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.