- Hands-On Object:Oriented Programming with C#
- Raihan Taher
- 796字
- 2021-07-02 12:44:38
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.
- Java EE 6 企業(yè)級(jí)應(yīng)用開(kāi)發(fā)教程
- MATLAB圖像處理超級(jí)學(xué)習(xí)手冊(cè)
- Mastering Swift 2
- Python自然語(yǔ)言處理(微課版)
- Lua程序設(shè)計(jì)(第4版)
- Python程序設(shè)計(jì)案例教程
- 打開(kāi)Go語(yǔ)言之門(mén):入門(mén)、實(shí)戰(zhàn)與進(jìn)階
- 輕松上手2D游戲開(kāi)發(fā):Unity入門(mén)
- 時(shí)空數(shù)據(jù)建模及其應(yīng)用
- Learning Shiny
- Offer來(lái)了:Java面試核心知識(shí)點(diǎn)精講(框架篇)
- Effective C++:改善程序與設(shè)計(jì)的55個(gè)具體做法(第三版)中文版(雙色)
- SaaS攻略:入門(mén)、實(shí)戰(zhàn)與進(jìn)階
- Java Web 從入門(mén)到項(xiàng)目實(shí)踐(超值版)
- C語(yǔ)言進(jìn)階:重點(diǎn)、難點(diǎn)與疑點(diǎn)解析