Interacting with Items

The Solution Explorer supports different management actions depending on whether you are currently interacting with a solution or a project. In fact, supported commands might 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.

There are two primary interfaces for interaction within Solution Explorer: the toolbar and the context menu. Let’s review the primary features.

Table 5.3 shows the various buttons hosted in the Solution Explorer’s toolbar, along with their specific scope.

Image

TABLE 5.3 Solution Explorer Toolbar Buttons

Managing Solutions

Clicking the solution in Solution Explorer immediately exposes all the valid management commands for that solution. As stated earlier, you access these commands through either the Solution Explorer toolbar or the context menu for the solution (which you access by right-clicking the solution). Through the toolbar and the solution’s context menu, the Solution Explorer allows you to do the following:

Image View and set the properties for a solution

Image Build/rebuild a solution

Image Directly launch the configuration manager for a solution

Image Set project dependencies and build order

Image Add any of the various Visual Studio-supported solution and project items

Image Run code analysis against all the files in the solution

Image View code metrics for all the files in the solution

Image Add the solution to the source control

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.

Image

FIGURE 5.2 The solution context menu.

Managing Projects

Just as with solutions, Solution Explorer provides various ways to manage projects within a solution, including the following:

Image Opening a project item

Image Building or rebuilding a project

Image Adding items to a project

Image Adding a reference to a project

Image Cutting, pasting, renaming, or deleting a project within the solution tree

Image Editing project properties

Image Running code analysis against all the files in the project

Image Viewing code metrics for all the files in the project

Image Unloading a project

Image Limiting the scope of the Solution Explorer to a single project

Image Launching a separate instance of the Solution Explorer window scoped to a single project


Note

The current startup project for a solution is indicated with a bold font (as is the OrderEntry project in Figure 5.1). If multiple projects are selected as startup projects, the solution name is instead bolded.


Figure 5.3 shows the project context menu for a class library project.

Image

FIGURE 5.3 The project context menu.

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 allows you to open them simultaneously in their editor windows either by right-clicking or typing the Enter key.

You can move and copy items within a solution, within a 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset