官术网_书友最值得收藏!

Solution Explorer

The folders and files are hierarchically depicted in the Solution Explorer. Solution Explorer is the main window and lists the entire solution that is loaded to the IDE. This gives you a view of projects and files that have a solution for easy navigation in the form of a tree. The outer node of the Solution Explorer is itself a solution, then the projects, and then the files and folders. The Solution Explorer supports loading folders inside the solution and storing documents in the first level, too. The project that is set as startup is marked in bold.

There are many buttons present at the top of the Solution Explorer called toolbar buttons. Based on the file that's selected in the tree, the toolbar buttons will be enabled or disabled. Let's look at each of them individually:

  • Collapse All button: This button allows you to collapse all of the nodes below the node that's currently selected. While working with a big solution, it is often necessary to collapse a portion of the tree completely. You can use this feature without collapsing each node manually.
  • Properties: As a shortcut to the Properties window, you can select this button to open the Properties window and load the metadata associated with the currently selected node.
  • Show all files: A solution is generally mapped to a Folder structure on a directory in the filesystem. The files that are included in the solution are only shown on the Solution tree. Showing all files allows you to toggle between viewing all files in the directory and only the files that have been added to the solution.
  • Refresh: This refreshes the state of files in the current solution. The Refresh button also checks every file from the filesystem and shows its status accordingly (if any).
  • View Class Diagram: The class diagram is the logical tree of namespaces and classes rather than the files in the filesystem. When you select this option, VS launches the class diagram with all of the details of its properties, methods, and so on. The class diagram is useful for viewing all of the classes and their associations individually.
  • View Code: When you select a code file, the View Code button appears, which loads the code file associated with the current selection. For instance, when you select a Windows Form, it will show its code behind where the code needs to be written.
  • View Designer: Sometimes, based on the file type that is selected in the tree, the View Designer button appears. This button launches the Designer associated with the currently selected file type.
  • Add New Folder: As I have already stated, a solution can also contain folders. You can add folders directly to the solution by using the Add New Folder button.
  • Create New Solution: Sometimes, when working with large projects, you might need to create a subset of the entire solution and list only the items that you are currently working on. This button will create a separate Solution Explorer that is in sync with the original Solution Explorer, but projects a specific portion of the solution tree.

The solution tree in VS also loads the class structure of the project in the way it is organized in the filesystem. If you see a collapsed folder, you can expand it to see what is inside it. If you expand a .cs file, all of the members of that class are listed. If you just want to see how the classes are organized, you can use the class view window, but by using the Solution Explorer, you can see the classes, as well as the other elements inside its own hierarchy. You can open the Class View by choosing View | ClassView or pressing Ctrl + W and C, so that you can view only a portion of the class and its members:

Some files are shown in the solution as blank files (in our case, folders such as bin and obj). This means that these files exist in the filesystem but are not included in the solution file.

Each file shows additional information on the right-hand side of the tree node in the solution. This button gives extra information that's associated with the file. For instance, if you click on the button corresponding to a .cs file, it will open a menu with Contains. This will get the associated class view for that particular file in the solution. The menu can be pretty long, depending on the items that cannot be shown in the generalized toolbar buttons. When the solution loads additional information, there are forward and backward buttons, which can be used to navigate between views on the solution.

主站蜘蛛池模板: 佛冈县| 舒兰市| 宁安市| 兴业县| 固原市| 沁水县| 齐河县| 长寿区| 垣曲县| 普宁市| 平乡县| 郯城县| 古蔺县| 中超| 托里县| 墨玉县| 镇安县| 延安市| 沈丘县| 望江县| 邹平县| 中阳县| 元氏县| 衡水市| 青河县| 南溪县| 柳江县| 定襄县| 大荔县| 祁门县| 高雄市| 兴业县| 清徐县| 双辽市| 道真| 湄潭县| 中阳县| 丽江市| 唐河县| 英吉沙县| 成都市|