4.3. Class View

Although the Solution Explorer is probably the most useful tool window for navigating your solution, it can sometimes be difficult to locate particular classes and methods. The Class View tool window provides you with an alternative view of your solution that lists namespaces, classes, and methods so that you can easily navigate to them. Figure 4-3 shows a simple Windows application that contains a single form, Form1, which is selected in the class hierarchy. Note that there are two SampleWindowsApplication nodes. The first is the name of the project (not the assembly as you might expect), while the second is the namespace that Form1 belongs to. If you were to expand the References node, you would see a list of assemblies that this project references. Drilling further into each of these would yield a list of namespaces, followed by the classes contained in the assembly.

Figure 4.3. Figure 4-3

In the lower portion of Figure 4-3 you can see the list of members that are available for the class Form1. Using the right-click shortcut menu, you can either filter this list based on accessibility, sort and group the list, or use it to navigate to the selected member. For example, clicking Go To Definition on InitializeComponent() would take you to the Form1.Designer.vb file, which would normally be hidden in the Solution Explorer.

The Class View is useful for navigating to generated members, which are usually in a file hidden in the default Solution Explorer view. It can also be a useful way to navigate to classes that have been added to an existing file — this would result in multiple classes in the same file, which is not a recommended practice. As the file does not have a name that matches the class name, it becomes hard to navigate to that class using the Solution Explorer; hence the Class View is a good alternative.

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

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