I'm struggling here.. I know I can disable the warning manually. However I'm not sure if this would be the right way to go about this.
Here's my interface..
vbnet Code:
Public Interface IPopulatingClassBase
Property Identity() As Int64
ReadOnly Property Dirty() As Boolean
Sub Populate_Class(ByVal RecordID As Int64)
Sub Save_Class()
Sub Reset_Class()
End Interface
Here's my parent class...
vbnet Code:
Public Class Parent
Implements IPopulatingClassBase
Public Property Identity() As Int64 _
Implements IPopulatingClassBase.Identity
'...
End Property
Private Dirty() As Boolean = {False, False}
Public ReadOnly Property Dirty() As Boolean _
Implements IPopulatingClassBase.Dirty
'...
End Property
Friend Sub Populate_Class(ByVal ParentID As Int64) _
Implements IPopulatingClassBase.Populate_Class
'...
End Sub
Friend Sub Save_Class() _
Implements IPopulatingClassBase.Save_Class
'...
End Sub
Public Sub Reset_Class() _
Implements IPopulatingClassBase.Reset_Class
'...
End Sub
End Class
Here's my derived class..
vbnet Code:
Public Class Derived
Inherits Parent
Implements IPopulatingClassBase
Public Property Identity() As Int64 _
Implements IPopulatingClassBase.Identity
'...
End Property
Private Dirty() As Boolean = {False, False}
Public ReadOnly Property Dirty() As Boolean _
Implements IPopulatingClassBase.Dirty
'...
End Property
Friend Shadows Sub Populate_Class(ByVal DerivedID As Int64) _
Implements IPopulatingClassBase.Populate_Class
'...
End Sub
Friend Shadows Sub Save_Class() _
Implements IPopulatingClassBase.Save_Class
'...
End Sub
Public Shadows Sub Reset_Class() _
Implements IPopulatingClassBase.Reset_Class
'...
End Sub
End Class
I obviously get the warnings in the derived class, but I feel this should be allowed. I've read vb.net doesn't whereas c# does. Is there a way around this or should I just create separate interfaces? (Which I feel defeats the entire purpose of an interface.)
PS In my example think of it as classes that populate with data from a database. The parent class would be an organization, and the derived class a location. Both populate and have similar functionality. The only difference is locations are an entity of an organization(the data record for a location constraints it to an organization) upon loading location data I also populate the organization class. This is a real example of what my project does.. so having said I just want to know how I can get around this warning, and if not would it have any consequences if I left it as-is.
Thanks in advance
David