c# - Multi-level interface inheritance with .NET and COM Interop -


This question is in compliance with COM interop for me.

Assume that I implement the following 2 interfaces and classes:

  Public Interface Esquitum {public string SKU {get; Set; }} Public Interface ICartItem: ISkuItem {Public Int Amount {Received; Set; } Public Boole isdiscountable {get; Set; }} Public class CartItem: ICartItem {// implemented properties ...}  

Or, in VB.NET:

  public interface ISkuItem property SKU ( ) As the string end interface folk interface ICartItem inherited ISkuItem property volume () Integer property IsDiscountable (as) Boolean end interface Folk Classes CartItem Implements ICartItem 'Apply Properties' as the End Class  

The interface is important in VB6 IDE (copy) properties of IntelliSense and COM Interop to highlight methods. However, because ICartItem ISkuItem , SKU is not explicitly defined in ICartItem and received in this way Does not appear in IntelliSense in VB6 and even throws a compiler error trying to write objCartItem.SKU .

I have tried using shadow and overloads squ on ISkuItem property, but then The compiler wants to explicitly apply me to SKU for both > ISkuItem and ICartItem within CartItem category. I do not think what I want.

SKU There is no way to explicitly declare the property in (in VB.Net or C #) ICartItem SKU croreitim without declaring twice in class


Comments