how do i copy all items from a generic collection to a class that inherits
from a generic class *** within *** that class?
i have a class that inherits from BindingList and within it i have a method
that generates a List , perfoms operations on it, and then copies all its
elements into the inheriting class.
If this was outside the inheriting class i could use the overloaded
constructor which takes a Generic IList however i cant do this within the
class as it gives, understandably, "'Me' cannot be target of an assignment"
I dont really want to have to iterate through the List, copying each item in
but if all else fails i will have to.
my code (simplified) should look like this:-
Dim myList As New List(Of thing)
myList = New List(Of thing)(me)
MyList.Sort()
'i want to do something like:-
Me = New MyInheritedBindingList(Of thing)(myList) 'this line is
not allowed
'but it looks like i will have to do:-
Me.Items.Clear
For Each it as thing in myList
me.items.add(it)
next
guy