Visual Studio 2012: List of all Methods in class - c#

In VS 2010, is there a way to see all the Methods in a docked window for the currently viewed class. Clicking the method would let me navigate to it.
This question is for design mode, while editing a class in the IDE.
I own Resharper, but don't see a way to see all the methods in a nice list as a feature.

If you have Resharper at your disposal as you indicate, you can use the File Structure window. It looks like this:
To open it, click Resharper, Windows, "File Structure". The window is dockable, and updates as your current file changes.

View -> Class View or Ctrl+Shift+C
You see the different classes on the top panel and the methods on the bottom panel.
Also, you have the method list on the top part of your tab:

You have VS 2012. This version has enancements in Solution Explorer.
If you expand a class file node you will see all classes.
And if you expand a class node you will see all its members.
See http://blog.wpfwonderland.com/2012/08/04/visual-studio-2012-tidbits-01-class-members-in-solution-explorer for an explanation.

Related

VSIX extension to select class

I want to develop an extension for Visual Studio 2017 which will allow user to right click on C# class and choose to invoke wizard from the context menu. I see here that it is possible with VSIX template. I also looked into Roslyn and feels that it might be the way to go forward but not sure. Basically I wan to select the class and read all it's properties hierarchically to show it in tree view and let user decide select from those. The point I am stuck at is if it is possible in Roslyn and can I use C# reflection there as well.
Thanks
Jay

Explore object's members like in debug but without debug

Is there any extension for visual studio that can display object's properties / members / methods without debugging the code?
Like it shows in debug when you hover over an object it shows a menu where you can easily navigate between object's members.
I'm looking for extension that can do the same without debug.
If its important the language that I'm working with is C#
Not exactly what you asked for, but you might find the relatively new "peek definitions" in visual studio helpful:
Place the caret / focus on some variable or object, and press Alt + F12.
That will open a sort of internal mini window in VS, showing the contents of the variable.
You can repeat this to step further down in thorough the internals of whatever object you are exploring. Dots at the top of the window show how many levels down you've navigated, and you can click them to move between levels.
In this example I'm at the third level down, as indicated by the blue dot:
This is a great feature for exploring the internals of your class hierarchies without actually opening a bunch of files and cluttering up your main VS window.

Visual Studio 2013 Update 2 - Remove Project dropdown in C# navigation bar?

I recently updated my Visual Studio 2013 to Update 2 RTM. Now for my C# files, the navigation bar has a new dropdown for Projects, instead of just having Types and Members like it used to. The Projects dropdown is taking up valuable screen real estate.
Is there a way to hide that Project dropdown in the navigation bar?
See this link for a picture of what a navigation bar looks like.
Update: I added a picture of what my navigation bar looks like for a C# file.
I don't think as things currently stand that you can disable it, but its name is apparently "Context Switcher".
According to this MSDN blog, it would appear to be a new feature intended to help you manage shared files in Universal Apps. I agree that it's confusing, and I'm not a big fan.
A thorough search of the VS options for anything related to "Navigation Bar", "Context Switcher", or "Universal Apps" comes up empty and there don't seem to be any extensions offering this capability either. As far as I know these would be the main avenues for configuration, so my conclusion is that we are stuck with it until the next VS update or until someone gets around to making an extension that can disable it.
If you prefer, you can disable the navigation bar entirely in "Tools > Options > Text Editor > All Languages > Navigation Bar" (or you can disable the bar on a language by language basis.)
Update: As of Visual Studio 2013 Update 3, you can drag and adjust the relative sizing of the 3 drop down lists in the navigation bar.
From a little local testing it looks like the sizing you set is shared between all files and solutions and it persists after closing and reopening visual studio.
I shrank the context switcher down to just the visible text, and it feels more well proportioned and closer to the classic Class and Member drop down layout.
A specific issue has been opened at:
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/5748900-add-option-to-exclude-the-new-shared-file-dropdow
Please vote !
In Visual Studio 2013 Update 3, which was released this week (http://www.visualstudio.com/news/2014-aug-4-vs) , we have added the ability to re-size the splitters in the Navigation Bar to your own taste. We will save this setting for you. This means if you don't want to use real-estate on the Context Switcher, you can make it very small, but without changing the keyboard behavior of the Navigation Bar. We hope you like this change, which will also appear in the next public release of Visual Studio "14".
There is no (official anyway) way to hide the project dropdown currently. We are considering it though.
Please file a suggestion on http://visualstudio.uservoice.com or file a bug on https://connect.microsoft.com to get your feedback heard.

List Box, c# Visual Studio 2010

One small question. I know the toolbox in Visual Studio has all the necessary components, but I was wondering if we could introduce our own "custom-made" tools. For example, the listbox tool. I've created a "SpeechListBox" class in which I've mentioned all the methods that I want my listbox to use, but when I'm in the "SpeechListBoxApplication" class (where I wanna use this listbox), the listbox with my methods doesn't show up, instead the general listbox tool that doesn't have my methods shows up.
What I want is to write something like private speechListBox1 SpeechListBox; and somehow introduce a visual form to the design class without confusing it with the toolbox's listbox. Making the program realize that I want this type of list box with all the extended methods, not the general toolbox type.
Is there any way to either make our own listbox or add methods to the original listbox tool?
Well, if you derive your SpeechListBox from a class that either is or derives from System.Windows.Forms.Control, when you compile your project it will show up in the Visual Studio control toolbox.
If you aren't sure which class to derive from, you'll have to make some decisions. If you want to hand-draw everything yourself, derive straight from Control itself. If you want to build a control is is a composite of other controls, consider deriving from UserControl. You don't explicitly list exactly what you're trying to do with your SpeechListBox, but you may want to consider just using a ListBox but supplying it with custom drawn list items. You could do this by making your class derive from ListBox or just configuring a ListBox to do what you want right in the form on which the listbox resides.
Is your code in separate project? Then you have to add that project to your SpeechListBoxApplication project's references in the solution explorer.
Otherwise your inherited control (public class SpeechListBox : ListBox) should show up, when in the GUI Designer in the toolbox in either the Common section or a section labeled after the project.

Is there a utility that can monitor open windows/ in .net winforms?

This is a general question, but I'll explain my specific need at the moment:
I want to find the framework class that enables one to choose an image at design-time. I can find the editor that is used at run-time - its the Drawing.Design.ImageEditor. At design time, however, a different editor pops up which allows one to choose an image from resources.
I'm guessing I could run some kind of program, then open up the image editor, from the property grid, and see what new windows/classes have been created?
Thanks
Yes, you can see what's being used by using another instance of Visual Studio and use Tools + Attach to Process (managed) to look at the call stack. It is a Microsoft.VisualStudio.Windows.Forms.ResourcePickerDialog. That is not something you can use in your own code, the Visual Studio designer assemblies are not re-distributable. Nor would they be useful, they monkey with the design-time state of the project.
Making you own isn't that hard, just use Reflection to iterate the properties of Properties.Resources and find the ones that have the Bitmap or Icon type. Display them in a ListView to allow the user to pick one. Adding resources at runtime isn't an option.
A tool with similar functionality to what you mention is Spy++ which you can find in your Visual Studio folder on the start menu (under the sub menu Visual Studio Tools).
However, if I understand you correctly, I don't think the design time editor you're talking about is written in managed code and even if it was, I'm fairly sure it's not in the framework. It's just part of Visual Studio itself and as far as I know you can't get hold of the source code for that.

Categories

Resources