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 523 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 444 comments.