RE: Two Classes with the same Data Structure.. saving code? Inheriting
a structure?
I have two classes. One in Inherits System.Collections.CollectionBase,
the other does not, but they both have the identical structure and
properties. the only difference between them is there methods and that
one is a collection class and the other is not.
currently the code starts like this:
class1
Namespace WH
Public Class colCollaborator
Inherits System.Collections.CollectionBase
Public Structure s_Collaborator
Private m_Result As String
Private m_ColId As Integer
Private m_Lastname As String
Public Property ColId() As Integer
Get
Return m_ColId
End Get
Set(ByVal value As Integer)
m_ColId = value
End Set
End Property
... more code
class2
Namespace WH
Public Class Collaborator
Private m_ColId As Integer
Private m_Lastname As String
Private m_Firstname As String
Public Property ColId() As Integer
Get
Return m_ColId
End Get
Set(ByVal value As Integer)
m_ColId = value
End Set
End Property
....
Dumb noob question that I can't figure out despite endless resources..
is it possible to share or inherit that structure in both classes ..
and consolidate class files?
Thanks for any help or information!