Is there a setting or option somewhere that changes the collapse behavior for classes so that derived classes show their parents? It's dumb, and maybe a bit pedantic, but when you have classes that derive in multiple levels and branches, it's a slight annoyance not to be able to see them at a glance.
Expanded:
Collapsed:
Related
The TFS pending changes view (VS2010) is annoying to use, especially the fact that the hierarchy view is always expanded. Further when I check in a few files, the pending changes view is refreshed and all the items are expanded and is selected. Considering there are multiple solutions in the workarea (which are functionally and logically disjoint) and at any time I could be working on multiple tracks, the auto refresh, expand and select forces me to go through each node and collapse and deselect it.
A bit of searching brought me to this page where there specify a workaround to have the Hierarichal view selected by default using macros. Extending this method to resolve the above issue didn't materialize as I believe the events of node collapse and deselection are not getting recorded.
Is there any solution to this issue similar to say the VS Power Tool which provided an exceptional feature 'Collapse All', that collapses all the projects in the solution!
Your complain is not new, many many people complained about that to MS for year, unfortunately there's no real solution.
There's no workaround for the expand/collapse issue, but to improve the experience when you deal with many changes in multiple solutions you can activate the "filter by solution" item to only show the pending changes of the current opened solution. It reduces the number of items, hoping things will get better for you.
As Dave Shaw said the experience was totally refactored in VS11, it's much better now.
This question arises because I want to capture LostFocusEvent from Dialog. Unfortunately, this event is not fired for non Component derived components. What I want to ask is what is the aim of Dialog not derived from Component, but RichWindow, as compared to the Swing library?
I think really the best way to get the answer is to contact Ingo Maier directly, but you may be able to deduce the some of the thinking behind from his blog article The scala.swing package in 2.8 and beyond:
Window hierarchy
This is how the Java AWT/Swing window hierarchy looks like:
While AWT's Frame and Dialog share the common base class Window, the Swing extensions have no subclass relationship or extend a common interface even though they share common functionality not present in AWT. In an attempt to straighten things up a little, we redesigned the window base hierarchy in scala.swing which now looks as follows:
[...]
This design lets us factor common wrapper code into class RichWindow.
So I am guessing that this is a deliberate design by the author stating that Windows are in fact not components in the same way frames and buttons are, and can be dropped on to other containers.
My favorite way to find subclasses of class 'X' or implementations of interface 'Y' has been to use Red Gate's Reflector. But I'd like to know if there is a (free) way to do the same thing from VS 2010. Does 2010 already have this ability? Is there a plugin I can add?
The object browser, the place I might expect this feature to be found, does not seem to have this capability. It can tell you about a parent type, but it does not tell you about derived types.
A more non-straight forward but works in all cases is to temporarily change the class/interface that you are modifying to abstract and add a abstract method.property and rebuild the solution :) all the build errors would point you towards the direct/indirect children.
While I've not found a RedGate Reflector level of functionality for this need, I have started using a partial solution. Using the regex search capability in VS, I enter the following:
\:.#<place base class or interface here>
Example:
\:.#MyBase
Any derivative interface or class made from "MyBase," defined in the solution, will be returned.
I've just found free Inheritance Margin Extension.
With this I can view inheritance info right in the code editor and also navigate to base/overridden items (with right mouse click on the inheritance glyph).
When I generate class diagram in Visual Studio 2008 using View Class Diagram I always get a bunch of class boxes without methods. The only lines in the diagram are inheritance.
Is it possible, and if so how do I get associations (aggregation and composition might not be possible, but at least an association line indicating they are some how connection. Preferably with an arrow) visualized?
And is it possible to change it so that methods are shown after generating a diagram by default?
To show a property as an association just right click on a property in the diagram editor (not the Class Details panel) and choose either "Show as Association" or "Show as Collection Association". Obviously you will need to make the property visible in the diagram editor first. Typically I only show public properties.
And I don't believe there is a way to always show associations.
Is there some way to make the Watch window display all inherited properties and fields in one long flat list, rather than hidden behind a nested "base" node?
I'm debugging some C# code that makes massive use of inheritance - some of the properties I want to watch are behind three levels of "base" in the Watch window. This would be more or less bearable if I just wanted to examine a single such object, but I'm actually looking at a tree of them...
see http://blogs.msdn.com/b/jaredpar/archive/2010/02/19/flattening-class-hierarchies-when-debugging-c.aspx
UPDATE: I wrote a commercial tool called OzCode that solves this problem. The idea is that if you're interested in a property of the base class, you can "Star" that property, which causes the property to appear at the top of members list, and also in the text of its parent.
So for example, in the following scenario, I had to expand two base nodes to get to see the properties I wanted, "Important" and "Interesting":
But once I star these properties, they will always appear at the top, even when viewing variables of the Derived type, so I'll see:
These stars are persisted and will be shown whenever you view a an object of that type in the DataTip or QuickWatch window from that moment on, so the next time you a variable of that type, you won't need to expand those "base" nodes. And because starred values appear as the parent node's text, if you're looking at a tree datastructure of these heavily nested objects (as you stated you were), you will be able to see these properties without even expanding the nodes at all.
FULL DISCLOSURE: I'm the co-author of the tool I've described here.
Not as such. You see, it is a feature! The ability to see where a property comes from is important most of the time.
I understand your pain though. There are some work arounds. First, you can just put the object.property in the watch window. This will just display the property you are looking for. It is great for digging into a specific property but not so much for getting all the others.
You can also try (BaseClass)object. This will cast it to the base object that contains the property (properties?) you are looking for. Again it is great for looking a a specific subset of properties but completly hides all the others.
Good luck and good hunting.