Code Expansions and Surround with Technology Visual Studio (Web site builder)
Sunday, February 17th, 2008Code Expansions and Surround with Technology Visual Studio 2005 (as well as Visual C# 2005 Express) also has the capability to insert complex blocks of C# code using menu selections, context-sensitive mouse clicks, and/or keyboard shortcuts. The number of available code expansions is impressive and can be broken down into two main groups: Snippets: These templates insert common code blocks at the location of the mouse cursor. Surround With: These templates wrap a block of selected statements within a relevant scope. To see this functionality firsthand, right-click a blank line within your Main() method and activate the Insert Snippet menu. Once you select a given item, you will find the related code is expanded automatically (press the Esc key to dismiss the pop-up menu). If you were to right-click and select the Surround With menu, you would likewise be presented with a list of options. Be sure to take time to explore these predefined code expansion templates, as they can radically speed up the development process. Note All code expansion templates are XML-based descriptions of the code to generate within the IDE. Using Visual Studio 2005 (as well as Visual C# 2005 Express), you can create your own custom code templates. Details of how to do so can be found in my article Investigating Code Snippet Technology at http://msdn.microsoft.com. The Visual Class Designer Visual Studio 2005 gives us the ability to design classes visually (but this capability is not included in Visual C# 2005 Express). The Class Designer utility allows you to view and modify the relationships of the types (classes, interfaces, structures, enumerations, and delegates) in your project. Using this tool, you are able to visually add (or remove) members to (or from) a type and have your modifications reflected in the corresponding C# file. As well, as you modify a given C# file, changes are reflected in the class diagram. To work with this aspect of Visual Studio 2005, the first step is to insert a new class diagram file. There are many ways to do so, one of which is to click the View Class Diagram button located on Solution Explorer s right side (see Figure 2-22). CHAPTER 2 BUILDING C# APPLICATIONS 57 Figure 2-22. Inserting a class diagram file Once you do, you will find class icons that represent the classes in your current project. If you click the arrow image, you can show or hide the type s members (see Figure 2-23).
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.