Interface not shown in object browser on Base Types due to inheritance?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
If I have an interface (IFace) and I create a class that implements that interface as in ClassA then in the object browser IFace shows up in the Base Types.
If I then inherit from ClassA but also include an implement IFace statement in a new class ClassB then in the object browser IFace does not show up in Base Types.(I have to assume it optimizes it out as the base class contains it already)

This creates a problem for me in that Im using the Add-In Framework and it will not find ClassB if I use the function AddInStore.FindAddIns(typeof(IFace), addinRoot); in my host executable.

ClassA is actually a convenience class in another assembly that implements the interface and allows ClassB to override only what it needs to support.
In C# doing exactly the same thing IFace shows up in the base types of both classes in the object browser.
Is there any workaround for this in VB? (Besides not deriving from the base class and implementing the entire interface, which does work)
<img alt="" src=" Public Interface IFace
Function A() As Integer
Function B() As Integer
Function C() As Integer
End Interface

Public Class ClassA
Implements IFace
Public Function A() As Integer Implements IFace.A
Return 600
End Function
Public Function B() As Integer Implements IFace.B
Return 230
End Function
Public Function C() As Integer Implements IFace.C
Return 100
End Function
End Class

Public Class ClassB
Inherits ClassA
Implements IFace
End Class

View the full article
 
Back
Top