Object browser/outlining and inherited members

SyntaxEditor .NET Languages Add-on for Windows Forms Forum

Posted 17 years ago by Igor Velikorossov - Sydney, Australia
Version: 4.0.0246
Avatar
I seem to run into a problem which I am not totally sure I've approached from the right angle in the first place.

There is document outline treeview in the main form example, which acts pretty much like the Object Browser in VS.NET IDE, the main treeview of Reflector etc.

I've played and tweaked bits and pieces of the original DocumentOutlineUpdater class (as a side note perhaps it isn't the best name, for outline imho more associates with collapsable regions) to display only members based on required access level.

But there is one thing which I got stuck on - how to show inherited members for the class.
For example:
class A 
{
  protected int M1();
  private void M2();
}

public class B : A 
{
  public void M3();
}
I want the DocumentOutlineUpdater to show (assuming showing only public and protected memebers)
+ A
  - M1()
+ B
  - M1()
  - M3()
I did find that there is a IDomType.GetMembers(IDomType[], string, DomBindingFlags) method which supposedly may be the one I'm after, but I have no idea what parameters are needed to be passed on.

So to wrap it up, have I chosen the right path at all? If not what would be the way to show the inherited members (fields/properties/whatever else maybe visible to descendants)?

An on top of that, (sorry for the lame question) what is the difference between TypeMemberDeclaration.AccessModifiers and TypeMemberDeclaration.Modifiers? The help topic is rather short and uninsightful...


Thank you

Comments (2)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Correct, since it is a visitor pattern, it is only visiting the nodes it directly knows about, which are the ones declared in the type and not inherited.

Changing some things to use a GetMembers call is a possibility, however you would want to call DotNetProjectResolver.GetMembers(IDomType) instead since that will walk up the inheritance hierarchy and get all members. IDomType.GetMembers only looks at that specific type.

AccessModifiers actually hits the Modifiers property and applies a bit mask to it so that only access modifiers (Public, Protected, etc.) are returned.


Actipro Software Support

Posted 17 years ago by Igor Velikorossov - Sydney, Australia
Avatar
I'll give it a go. Thank you.
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.