• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 644
  • Last Modified:

I want to see the inheritance hierarchy of classes of C# in VS 2010 just as Java in Eclipse. How?

Hi there;

I want to see the inheritance hierarchy of classes of C# in VS 2010 just as Java in Eclipse. How?

Kind regards,
0
jazzIIIlove
Asked:
jazzIIIlove
  • 5
  • 5
  • 3
  • +1
1 Solution
 
Paul JacksonCommented:
You tried the object browser. View menu --> Object Browser or CTRL+ALT+J
0
 
jazzIIIloveAuthor Commented:
Hi there:

I couldn't get which one is abstract which one is concrete class?

and is there a way to have only the left pane or right pane, as I need to see my code too just as in eclipse.

Kind regards.
0
 
Kevin CrossChief Technology OfficerCommented:
Try View > Other Windows > Class View (Ctrl + Shift + C) and see that is what you are looking for.  An alternative is to right-click on your project and select view class diagram.  It will be in the code pane though and so may not be desirable, but you can detach it if you have multiple screens that may be helpful.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
Bob LearnedCommented:
For those of us who don't work with Java Eclipse, what kind of layout are looking for?  It sounds like a job for Reflector, but it is difficult to know, since I don't know Eclipse.
0
 
Kevin CrossChief Technology OfficerCommented:
TLO, here are some screen shots.  Package Explorer is like Class View.  As you can see Java has graphical notations that indicates if a class is Abstract.  Java Package Explorer
That is off to the side and so you can still code.  Think the Class View in VS is very much the same as this.  However, not sure that is what is being looked for here as Op wants "to see the inheritance hierarchy" which looks something like this in Eclipse: Java Hierarchy View
I think the View Class Diagram shows this, but it isn't off to the side so you can still code as you see in the illustration of Eclipse's version.  

Hope that helps as I am sure you use VS way more than I do. *smile*  
0
 
Bob LearnedCommented:
Thank you Kevin!!  That output looks like what I was thinking of, and reflection applications like Reflector and ILSpy give you a lot more information (hierarchically), vs. the Class View.  You can see decompiled code, and whether a class is abstract, virtual, sealed, internal, public, etc.


ILSpy.png
0
 
jazzIIIloveAuthor Commented:
Hi there;

Ok, so, in practice, in VS 2010, how can one understand whether the class is inherited or not except for going for its definition? So, I just want hierarchy on the left handside and my coding pane in the right hand side and check for the hierarchy while coding. No way, in VS 2010?

Kind regards.

P.S.I have got the reflector
0
 
Bob LearnedCommented:
If you need to see hierarchy, the only thing that I can think of is the Call Hierarchy window (right-click on a member in the code window, and select "View Call Hierarchy".

 
Snapshot.png
0
 
jazzIIIloveAuthor Commented:
Ok, thanks, Calling hierarchy is cool but I cannot get whether the class is concrete or not. So, how can you understand whether a class is concrete or abstract in C# easily?

Kind regards.
0
 
Bob LearnedCommented:
If you have Reflector, then you should see the declaration like this:

System.Data.SqlClient.SqlDataAdapter:


public sealed class SqlDataAdapter : DbDataAdapter, IDbDataAdapter, IDataAdapter, ICloneable
{

System.Data.Common.DbDataAdapter:

public abstract class DbDataAdapter : DataAdapter, IDbDataAdapter, IDataAdapter, ICloneable
{

 
0
 
jazzIIIloveAuthor Commented:
ok, thank you.
0
 
jazzIIIloveAuthor Commented:
Ah could we assign half of the points mwvisa1, to the comment; 20/05/11 05:39 PM, ID: 35802376

When I reconsider, he puts an effort for the clarification.

Kind regards.
0
 
Bob LearnedCommented:
I looked at the Object Browser, and it does have that information, too, just not the hierarchy.


Snapshot.png
0
 
Kevin CrossChief Technology OfficerCommented:
No worries here regards to points.  Glad you found something that worked.
Best regards and happy coding,

Kevin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 5
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now