I have a third-party method that returns an old-style ArrayList, and I want to convert it to a typed ArrayList (Of MyType).
Dim udc As ArrayList = ThirdPartyClass.GetValues() Dim udcT AS List(Of MyType) = ??
I made a simple loop, but there should be a better way:
Dim udcT As New List(Of MyType) While udc.GetEnumerator.MoveNext Dim e As MyType = DirectCast(udc.GetEnumerator.Current, MyType) udcT.Add(e) End While
vulkanino
source share