Hi,
I am new to VB.NEt and am creating a program where I have defined a generic class as follows:
I have several types of objects, and each needs a database of its own given above, along with a stamped version of the type, exposed to the outside world by the class MyDataBase(of T).StampedVersion
Now I need to define the iterating variable (in a for each loop) as
Dim CurStampedItem as MyDataBase(of T).StampedVersion
This works fine. But I wish to know if I could define the above in a more elegant fashion
Dim CurStampedItem as StampedVer(of T)
instead of defining it as a contained class of the generic class. Any ideas on how to do this? Thanks.
Shankar
I am new to VB.NEt and am creating a program where I have defined a generic class as follows:
VB Code:
Class MyDataBase(of T) Implements IEnumerable(Of StampedVersion) public Class StampedVersion dim OriginalItem as T dim StampNo as integer end class dim ListOfItems as List(of StampedVersion) 'other procedures 'implementation of enumerators end class
Now I need to define the iterating variable (in a for each loop) as
Dim CurStampedItem as MyDataBase(of T).StampedVersion
This works fine. But I wish to know if I could define the above in a more elegant fashion
Dim CurStampedItem as StampedVer(of T)
instead of defining it as a contained class of the generic class. Any ideas on how to do this? Thanks.
Shankar