15.02.2015 Views

C# 4 and .NET 4

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Working with Visual studio 2010 ❘ 393<br />

quickly added to your code; however, you might find this feature<br />

helpful for properties <strong>and</strong> indexers, where it can save you quite a bit<br />

of typing.<br />

The Object Browser Window<br />

One important aspect of programming in the .<strong>NET</strong> environment<br />

is being able to find out what methods <strong>and</strong> other code items are<br />

available in the base classes <strong>and</strong> any other libraries that you are<br />

referencing from your assembly. This feature is available through<br />

a window called the Object Browser. You can access this window<br />

by selecting Object Browser from the View menu in Visual Studio<br />

2010.<br />

The Object Browser window is quite similar to the Class View<br />

window in that it displays a tree view that gives the class structure<br />

of your application, allowing you to inspect the members of each<br />

class. The user interface is slightly different in that it displays class<br />

members in a separate pane rather than in the tree view itself. The<br />

real difference is that it lets you look at not just the namespaces<br />

<strong>and</strong> classes in your project but also the ones in all the assemblies<br />

referenced by the project. Figure 16-21 shows the Object Browser<br />

viewing the SystemException class from the .<strong>NET</strong> base classes.<br />

figure 16-20<br />

One note of caution with the Object Browser is that it groups<br />

classes by the assembly in which they are located first <strong>and</strong> by namespace second. Unfortunately, because<br />

namespaces for the base classes are often spread across several assemblies, this means you might have<br />

trouble locating a particular class unless you know what assembly it is in.<br />

The Object Browser is there to view .<strong>NET</strong> objects. If for any reason you want to investigate installed<br />

COM objects, you will find that the OLEView tool previously used in the C++ IDE is still available — it is<br />

located in the folder C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin along with several other<br />

similar utilities.<br />

figure 16-21<br />

The Server Explorer Window<br />

You can use the Server Explorer window, shown in Figure 16-22, to find out about aspects of the computers<br />

in your network while coding.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!