One of the really exciting new features of Visual Studio 2005 is the Class Designer. The Class Designer allows the programmer to quickly and easily set up the basic structure of a new class using a graphical interface. Using the Class Designer you name fields, properties, methods and events that make up a class. Fo each item you can specify the data types and parameters involved. The code will be created automatically. Not only that but if you add code in the code window and add, for example, a new field it will show up in the Class Designer window automatically.
To use the Class Designer select a class from from the Solution Explorer or from the Class View window and click on the View Class Diagram icon from the icon menu. You can also right click on a class and select iew Class Diagram from the drop down menu. When you open the Class Designer you will open the Class Diagram from and the Class Details form (at the bottom of the IDE). Click on add method, add property, add field or add event to add an item to your class. Type in a new name and then add values for the type, modifier and summary information which will show up in the comments. Click on the plus sign next to a named item to open up a new line for parameters.
It’s all really easy to use but easier to show than to describe. For that reason I have created a 7 and a half minute demo of this on the MainFunction website that you can watch if you’d like.
This and the previous entries in this series may be found in one place at this article.