The Solution Explorer is the primary tool for viewing and manipulating solutions and projects. It provides a simple but powerful hierarchical view of all solution and project items, and it allows you to interact with each item directly via context menus and its toolbar. Using Solution Explorer, you can launch an editor for any given file, add new items to a project or solution, and reorganize the structure of a project or solution. In addition, the Solution Explorer provides instant, at-a-glance information as to the currently selected project; the startup project for the solution; and the physical hierarchy of the solution, its projects, and their child items. The Solution Explorer is simply another window hosted by Visual Studio. It can be docked, pinned, and placed anywhere within the Visual Studio environment. It is composed of a title bar, a toolbar, and a scrollable tree-view region (see Figure 5.1). Figure 5.1. The Solution Explorer.
The tree view provides a graphics- and text-organizational view of the currently loaded solution. Figure 5.1 shows all of the various items and projects represented for an eight-project solution loaded in the IDE. Visual Cues and IconsEach item in the Solution Explorer is represented by a name and by an icon. Table 5.1 summarizes which icon is used to represent the supported item types.
Note The icons shown in Table 5.1 are a representative list that correspond to specific project and solution items within the IDE. Other files added to a project or solution will be represented by the icon associated with their file type. For example, a Word document will be represented by the standard Word document icon in the Solution Explorer. Icon OverlaysTo provide a visual cue about the status of a particular item, the Solution Explorer will overlay an additional graphical element over the item icon. These overlays are called signal icons. For example, when source code control is enabled, the Solution Explorer will visually indicate whether an item is checked out or not via a graphical overlay. Table 5.2 describes the signal icons used in the Solution Explorer.
The Solution Explorer supports different management actions depending on whether you are currently interacting with a solution or a project. In fact, supported commands may vary by project type as well. As an example, the Copy Web Project command button is available for web projects but not class library projects, whereas the Properties command button is available for all item types. Table 5.3 shows the various toolbar command buttons supported by the Solution Explorer, along with their specific context.
Managing SolutionsClicking on the solution in Solution Explorer will immediately expose all of the valid management commands for that solution. You access these commands either through the Solution Explorer toolbar or the context menu for the solution (accessed by right-clicking on the solution). Through the toolbar and the solution's context menu, the Solution Explorer allows you to
You can initiate some of these actions by using the Solution Explorer toolbar; you can access the balance in the context menu for a solution, as shown in Figure 5.2. Figure 5.2. The solution context menu.
Managing ProjectsJust as with solutions, Solution Explorer provides a variety of ways to manage projects within a solution. They include
Note The current startup project for a solution is indicated with a bold font (as is the Contoso.Fx.Integration project in Figure 5.1). If multiple projects are selected as startup projects, the solution name will instead be bolded. The default action when you double-click an item is to open it within its default editor or designer. Multiple select and drag-and-drop operations are also supported. For instance, multiselecting several code files will allow you to open them simultaneously in their editor windows. You can move and copy items within a solution, project, or between projects through the standard drag and drop using the left mouse button. You can also drag certain items from within a project and drop them onto a suitable designer surface. This is an easy way, for instance, to add classes to a class diagram: Simply highlight the code files that contain the types you want to add and drag them onto the class diagram designer window. |