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.
Related
I am currently in the final stages of releasing an add-in to Microsoft Word 2010 (this likely works for other versions of word as well) using C#, winforms, and Visual Studio Tools for Office. The goal was to create a quick tool to do some office automation and most of the code is written so I would like to avoid significant rewrites. I am very close to release but I work for a large organization that has rigorous accessibility checks. Their current issue is that the pane has a menu that the user can use to resize the pane.
The menu that is causing me all these problems:
Resizing the pane is not important, but the accessibility reviews insist that any visual element must be fully accessible by keyboard to a motor impaired user. First, I would like to know what this menu is called - I have been searching everywhere but can't find reference to it.
Second, I have three options, each of which would solve the problem, but none of which I know how to
I could make keyboard shortcuts that call that specific menu.
I could make keyboard shortcuts that call the same function as the "Size" feature of that menu (when you press "Size" the mouse snaps to the side of the Control Pane and allows the user to maker it larger or smaller) without actually calling it directly from the menu.
I could remove or disable the menu (apparently, if I can simply make that menu visible but inaccessible to all users that would satisfy the accessibility reviewer as it would prove that it is not a needed function).
Again, I do not know how to do any of the three options I listed there. Any help in doing so using C# in Visual Studio Tools for Office would be greatly appreciated.
Is there a way in Visual Studio to add some comment to my code while I am executing debugging?
If I try to do it Visual Studio tells me that changes are not allowed.
Searching on Google I found many people that ask about this feature but I can't find a real solution to insert some comment into my code (only bookmarks).
Is it impossible or is there a way to accomplish this operation?
I know that in Java (using Eclipse) I can do it and it is very comfortable
Why not use the bookmark feature of visual studio?
Look under Edit->Bookmarks->Toggle Bookmark. On my machine that's a shortcut of holding Ctrl and tapping K twice.
There are shortcuts for previous/next bookmark, disable all, etc, etc.
You can also see a list of all bookmarks in the Bookmark Window (under the View menu) which allows you to name your bookmarks...
If you have enabled Edit and Continue (E&C), you should be able to edit code while your program is in break mode, e.g. you've hit a break point. It should be enabled by default, but if for some reason it isn't, you can read how to enable E&C here. For 64-bit applications, support for E&C was added with .NET 4.5.1.
If you just want to add comments as a deugging aid, i.e. not 'real' code comments, you can use a datatip aka pinned watched window's comment. Hover your mouse over a variable until the watch window pops up, pin it (top button) then expand comments (bottom button) and type whatever you want. These pinned windows are retained in between debugging sessions, and so are your comments. Combine this with bookmarks for quick navigation (Ctrl-k-k, Ctrk-k-n). Shown in action here, additional info here
Sure! you can both add comments to your codes and even modify your codes while debugging your application.
But, remember: you should Enable and Disable Edit and Continue(see here) as khellang said, and check you are in break mode(rather than debug mode).
I have a lot of properties that were originally implemented using automatic properties. Is there an easy way to change automatic properties to fully implemented properties without having to basically delete the properties and start over? In VB, I believe this is possible with a certain combination of cursor position (right in front of the Get?) and a couple of tabs. Is this possible in C#?
In visual studio just type propfull then tab twice, see this link for other good code snippets
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.
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.