I am trying to create some levels of abstraction for a hardware interface i am writing and was wondering if there is some way that i can assign more than one interface as a single variabletype
The only way that comes to mind is to make a abstract class that impliments IDisposable and IDataEndPoint and then use that as my variable type and the base for my endpoints
GoogleFu, Stack Overflow and MSDN havnt provided any other ideas
Cheers!
ie
Public Class A
Impliments IDisposable
Public ReadOnly DataEndpoint as IDataEndpoint, IDisposable <---- something like this
Protected Overridable Sub Dispose(disposing as Boolean)
if disposing then
DataEndPoint.Dispose
end if
End Sub
Public Sub Dispose() Impliments IDisposable.Dispose
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
End Class
Why not having a type
DataEndointthat implements both interfaces andDirectCastthe property to the required interface when needed?