internal d class and partial classes

SyntaxEditor .NET Languages Add-on for Windows Forms Forum

Posted 17 years ago by Ilya
Version: 4.0.0234
Avatar
Hi,
I'm trying to get information about classes in the DotNetProjectreolver.

I'm using GetTypes() method. In the result collection there are ClassDeclaration objects and d objects. d is the internal class. I saw that d objects represent my partial classes.

How can I convert d object to ClassDeclaration object?

I think that need to represent partial classes as ClassDeclaration objects (or derived class form ClassDeclaration class).

Comments (5)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ilya,

The "d" class is probably an internal partial type container. It is a type that implements the IDomType interface though (so does ClassDeclaration).

So you can cast it to IDomType to access the member data within it. You shouldn't have to cast it to ClassDeclaration to get that data.


Actipro Software Support

Posted 17 years ago by Ilya
Avatar
I know this. I cast d object to IDomType. But I can get information only about one base type . What should I do toe get information about all base types. For exapmle, my partial class implements several interfaces. How can I get list of this interfaces' names?

Example,

inyetface IB
{
}

intarface IC
{
}

partial class A : IB, IC
{
}
I have d object with this partial class. I cast it to the IDomType. I get BaseType property and get information about IB. How can I get information about IC?


In the ClassDeclaration there is BaseTypes property which implements list of all base types for the class.
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ilya,

Yes this is an oversight in the IDomType interface that was pointed out to us yesterday or the day before by another forum poster. We need to change our code to make IDomType be able to return interfaces as well as BaseType (which it currently does). This then will let you process this sort of thing by using IDomType since in the case of partial classes it will let you see all the interfaces that the partial class implements.


Actipro Software Support

Posted 17 years ago by Ilya
Avatar
Thanks a lot! I'm waiting for your release with this feature!
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The next maintenance release now has an IDomType.GetInterfaces method that will return the interfaces for the type.


Actipro Software Support

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.