Posts tagged 'Object Browser'

Thursday, January 10, 2013

Tip 5.51: You can use the View.Forward (Alt+Right Arrow) and View.Backward (Alt+Left Arrow) global commands in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


In Tip 5.36, she discussed how you can navigate forward and backward with the Alt+Minus and Shift+Alt+Minus keyboard shortcuts, which are scoped specifically to the Object Browser. But there are two other commands, View.Forward and View.Backward, that also work in the Object Browser, just like Alt+Minus and Shift+Alt+Minus. View.Forward and View.Backward are global, meaning that other features within the IDE can use them. For example, Class View uses them in the same way as the Object Browser. But you're probably most familiar with these commands as Web Browser Forward and Web Browser Backward. If you are accustomed to using these commands elsewhere in the IDE, you'll feel right at home in the Object Browser.

VSTip5510

Happy Programming! =)
Posted by Nils-Holger at 10:10 AM with 439 comments.

Wednesday, January 9, 2013

Tip 5.50: Why the Object Browser has so many commands you can bind to (and how to create a keyboard shortcut to clear the search results)

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of  'Sara Ford'

Sara Ford's Blog


Sara Aside

As she has been writing the Object Browser tip series, she has noticed that there are a lot of commands available under Tools–Options–Environment–Keyboard. Just type ObjectBrowser and you'll see what she means.


VSTip5500

Technically, not all these commands need keyboard shortcuts. For example, the ability to sort objects by access level probably doesn't need a keyboard shortcut. But since they do have shortcuts, let's have some fun.... If you bind any of the Object Browser Settings options to a keyboard shortcut, you'll see that shortcut in the drop-down menu. She didn't know that until she started playing with this feature.

VSTip5500a

How can you take advantage of this? If you use the Object Browser a lot to search, you might find it meaningful to clear the search via the keyboard shortcut. The command View. ObjectBrowserClearSearch clears the search combo, thus clearing the Object Browser filter.
Happy Programming! =)
Posted by Nils-Holger at 1:16 PM with 428 comments.

Tuesday, January 8, 2013

Tip 5.49: You can export all your Object Browser customizations in a .vssettings file

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio" courtesy of 'Sara Ford'

Sara Ford's Blog


Over these past several tips, we've taken a close look at customizing your Object Browser experience, from sorting to searching to filtering, among other options. Your customizations can be saved to a .vssettings file via the Tools–Import And Export Settings dialog page, under General Settings–Object Browser Options.

VSTip5490

The good news is that the XML stored in the created .vssettings file for the Object Browser Settings is human readable, in case you need to make a quick tweak.
Happy Programming!
Posted by Nils-Holger at 1:26 PM with 441 comments.

Monday, January 7, 2013

Tip 5.48: How to use type-ahead selection support in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


You may have tried this tip on your own, just hoping it would work. But in case you never thought about it, the Object Browser supports type-ahead selection.

VSTip5480

Sara Aside

Back in the Visual Studio .NET 2003 days, she was on a quest for a while to have all lists in the IDE support type-ahead selection. She did what she could, so if you see a list that should support it and it doesn't, definitely file a bug with the Visual Studio Team. Maybe one day her quest will be completed.


Happy Programming!
Posted by Nils-Holger at 2:04 PM with 1120 comments.

Sunday, January 6, 2013

Tip 5.47: You can use a Find Symbol search (Alt+F2) in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Just like the previous tip that talked about going to an object's or function's definition, you can find all the references of what you have selected in the Object Browser.

VSTip5470

The command Edit.FindAllReferences is bound to Alt+F2. When you press Alt+F2, it brings up the Find All References window.

VSTip5470a

This is the same as using Find Symbol in the Find In Files window.
Happy Programming! =)
Posted by Nils-Holger at 1:48 PM with 653 comments.

Saturday, January 5, 2013

Tip 5.46: You can use F12 in the Object Browser to go to the definition of whatever is selected

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


On the context menu of both the Member pane (right panel) and the Object pane (left panel), you'll see the Go To Definition command. You can use this command to navigate directly into the code where whatever you have selected is defined (or you'll get a nice error message).

VSTip5460

The Edit.GoToDefinition command is bound to F12. Pressing F12 in the image just shown takes you to where Create() is defined in the code.
Happy Programming! =)
Posted by Nils-Holger at 3:38 PM with 1179 comments.

Friday, January 4, 2013

Tip 5.45: What are the two primary means of searching for objects in the Object Browser?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Now we'll move to the second toolbar in the Object Browser, which is all about searching.

VSTip5450

The search scope depends on what you have selected in the Object Browser Scope. For example, if you try to search for System.Web in a Console Application, you will not be very successful. There's also another way to search—it's using the Find And Replace window's Find Symbol functionality. You'll notice the Find Symbol search closely resembles the Object Browser search functionality.

VSTip5450a

Happy Programming! =)
Posted by Nils-Holger at 1:43 PM with 649 comments.

Thursday, January 3, 2013

Tip 5.44: You can show extension methods in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


This tip is new for Visual Studio 2008. You can learn more about extension methods in the documentation located at http://msdn.microsoft.com/en-us/library/bb384936.aspx for Visual Basic and http://msdn.microsoft.com/en-us/library/bb383977.aspx for C#. In Object Browser Settings, you'll see the Show Extension Methods option.
Now, when you have an extension method in your code (in her example, it's a module because she's using Visual Basic), you'll see a downward-pointing arrow.

VSTip5440

Happy Programming! =)
Posted by Nils-Holger at 2:06 PM with 674 comments.

Wednesday, January 2, 2013

Tip 5.43: How to stop displaying all inherited members in the Object Browser Member pane

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


The next option in Object Browser Settings is Show Inherited Members. When this option is enabled, you'll see all inherited members, including those inherited from System.Object.

VSTip5430

When this option is disabled, you'll see only Method1(), Method2(), and Method3().
Happy Programming! =)
Posted by Nils-Holger at 4:08 PM with 2700 comments.

Tuesday, January 1, 2013

Tip 5.42: What does Other mean in Show Other Members in Object Browser Settings?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


The Other in the Show Other Members option represents members that do not have an access level of public, private, protected, or inherited. For example, access levels of Friend (in Visual Basic) and Internal (C#) fit into this Other category. The Object Browser shows the Friend method with a blue diamond.

VSTip5420

Happy Programming! =)
Posted by Nils-Holger at 12:47 PM with 1822 comments.

Monday, December 31, 2012

Tip 5.41: You can mark methods and types as Hidden so that they don't appear in Microsoft IntelliSense or in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio, in ", courtesy of 'Sara Ford'

Sara Ford's Blog


Continuing from Tip 5.40, this tip is how to actually make something hidden or capable of being hidden. In the System.ComponentModel namespace, there's the EditorBrowseableAttribute class. Going back to the previous tip's Method1() and Method2() methods, you'll see in the following example how Method2() doesn't appear in IntelliSense, just like it doesn't appear in the Object Browser.

VSTip5410

Of course, you can still complete the line just shown with Method2(), and everything will compile successfully.
Happy Programming! =)
Posted by Nils-Holger at 12:46 PM with 526 comments.

Sunday, December 30, 2012

Tip 5.40: You can hide or show hidden members and types in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Sara Aside

She never officially tested the Object Browser but rather played back-up tester in case someone went on vacation, needed help analyzing failures during a full test pass, and so forth. When she wrote most of these tips, she had to browse the test cases and the documentation to make sure she described things consistently and to make sure she was not missing any functionality.

This tip is about the Show Hidden Types And Members option on the Object Browser Settings menu.

VSTip5400

When this option is enabled, any hidden types and members will appear, but they'll appear in a grayed-out state, as shown next in the Method1() and Method2() example, where Method2() is hidden.

VSTip5400a

Happy Programming! =)
Posted by Nils-Holger at 12:59 PM with 437 comments.

Sunday, December 30, 2012

Tip 5.39: You can choose whether to show base types in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


In the Object Browser Settings menu, there's the Show Base Types option.

VSTip5390

In the following example, MarathonController inherits from ControllerBase. When this option is enabled, under MarathonController you'll see the Base Types folder. If you've been wondering how to get rid of this (or have been wondering how to enable it), just toggle the setting.

VSTip5390a

Happy Programming! =)
Posted by Nils-Holger at 1:45 AM with 445 comments.

Friday, December 28, 2012

Tip 5.38: You can customize both your Object pane and Members pane in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Over the next several tips, we're going to take apart the Object Browser Settings menu that lists what appears in the Object Browser.

VSTip5380

The first set of options control your view preference in the Object pane, which is either by namespace or by containers. Think of these two options as a set of radio buttons that are mutually exclusive. The rest of the options are more like check boxes, since you can have all the show options enabled. If you choose View Namespaces (which is the default), all components are shown based on their namespace, just as you would expect. The idea here is that namespaces stored in multiple physical containers are merged, as shown here:

VSTip5380a

Now if you switch to View Containers, you'll see the physical containers, and then a breakdown of the namespaces that are contained in each.

VSTip5380b

Sara Aside

She always uses View Containers so that she doesn't feel so overwhelmed by seeing everything! =)

Happy Programming! =)
Posted by Nils-Holger at 12:49 PM with 452 comments.

Thursday, December 27, 2012

Tip 5.37: You can create a keyboard shortcut for adding references to a solution from the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Sara Aside

She was kind of surprised to see it in the list of commands. But, then again, one can never have too many keyboard shortcuts. =) To write this tip, she bound it to her pseudo random keyboard shortcut Ctrl+Alt+Shift+T. This is her generic, all-purpose keyboard shortcut that she uses for testing purposes.

As far as binding View.ObjectBrowserAddReference to a keyboard shortcut goes, she'll leave it up to you to decide how useful this is. Maybe the "keyboard shortcut for everything" users will enjoy it. As long as some object has selection—meaning it doesn't have to have focus (blue highlight) and has at least inactive selection (light gray highlight)—in the Objects pane (the leftmost pane), you'll get the following message box when you press the keyboard shortcut.

VSTip5370

And if there's nothing selected (meaning you probably have absolutely nothing in the Object Browser) and you press the keyboard shortcut, Visual Studio will just stare at you.
Happy Programming! =)
Posted by Nils-Holger at 2:28 PM with 1533 comments.

Wednesday, December 26, 2012

Tip 5.36: How to use navigate forward and back in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Another set of buttons on the Object Browser toolbar belongs to the Navigate Forward and Navigate Back actions.

VSTip5360

The pages you visit within the Object Browser are saved in MRU (most-recently used) order. This alone is somewhat exciting, but what really makes it exciting is a keyboard shortcut! The commands are View.ObjectBrowserForward and View.ObjectBrowserBack. If you are using the Visual Basic Development Settings, you'll see that the keyboard shortcuts are Alt+Minus for Back and Shift+Alt+Minus for Forward. If you use the Forward and Back functionality frequently and are not using the Visual Basic Settings, go to Tools–Options–Environment–Keyboard, and manually set the keyboard shortcuts there. Happy Programming! =)
Posted by Nils-Holger at 1:16 PM with 442 comments.

Wednesday, December 26, 2012

Tip 5.35: You can add references to your solution directly from the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Let's say that you find the component that you want to add to your solution. Typically, you go to Solution Explorer, right-click the project node and select Add References, bring up the Add Reference dialog box, and you know how the rest goes. Within the Object Browser, there's a toolbar button called Add To References located to the right of the "..." browse button and the forward/back navigation buttons. With the Accessibility assembly selected, click the Add To References In Selected Project In Solution Explorer icon to add the assembly.

VSTip5350

And now you'll see the Accessibility assembly added to the project.

VSTip5350a

Happy Programming! =)
Posted by Nils-Holger at 2:18 AM with 435 comments.

Monday, December 24, 2012

Tip 5.34: You can create a custom list of components for the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


You can create a custom components list for the Object Browser. There are two ways to reach the Edit Custom Component Set dialog box. Either click that little "..." browse button next to the combo box or click the Edit Custom Component Set option in the Browse combo box.

VSTip5340

Now you'll see the Edit Custom Component Set window, where you can add and remove components. And for old time's sake, she has added an Accessibility assembly.

VSTip5340a

Finally, when returning to the Object Browser, you get the following view.

VSTip5340b

Happy Programming! =)
Posted by Nils-Holger at 12:59 PM with 442 comments.

Sunday, December 23, 2012

Tip 5.33: You can specify to show components in your solution only in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


By default, the Object Browser shows you all the components in the latest .NET Framework version. But sometimes you don't need to know about the entire world, and you just want to focus on the objects in your solution. In the upper-right corner of the Object Browser, you'll see a Browse combo box. If you drop down the combo box list, you'll see the option for selecting My Solution.

VSTip5330

Happy Programming! =)
Posted by Nils-Holger at 2:02 PM with 445 comments.

Saturday, December 22, 2012

Tip 5.32: You can use Ctrl+Alt+J to open the Object Browser window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


You can use Ctrl+Alt+J to open the Object Browser window. The command is View.ObjectBrowser.

VSTip5320

Happy Programming! =)
Posted by Nils-Holger at 2:15 PM with 1383 comments.