This project is read-only.

How get information about hierarchy of interfaces?

Topics: Metadata Model
Feb 5, 2013 at 6:40 PM
Edited Feb 5, 2013 at 6:44 PM
I need to check whether ITestB implements(or derived from) ITestA.

How i can do it?

Test data for example:
interface ITestB:ITestA

class TestB: ITestB
I need check that ITestB implements(or derived from) ITestA.

INamedTypeDefinition.Interfaces - returns all interfaces parent interfaces with parent interfaces.
But it returns ITypedReference that doesn't contains Interfaces property and ResolvedType returns Dummy.

So i can't check hierarchy.
Feb 6, 2013 at 12:15 PM
reference the assembly Micorosoft.Cci.MetadataHelper and have a look at the static TypeHelper class. you're probably interested at TypeHelper.Type1ImplementsType2(ITypeDefinition type1, ITypeReference type2).