Defining Methods, Properties, Fields, and Events

The most exciting part of the class designer is that it allows you to do more than define classes and relationships. You can actually stub out code and do refactoring. (See Chapter 9, “Refactoring Code,” for details.)

There are two ways to add code to your classes, structs, interfaces, and the like. The first is to type directly into the designer. For example, if you are in the Properties section of a class, you can right-click and choose to add a new property. This places the property in your class and allows you to edit it in the diagram. This method works for other class members as well. It does have a couple of drawbacks, however. You can’t, for instance, define a full method signature or indicate ...

Get Microsoft Visual Studio 2015 Unleashed, Third Edition 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.