Namespace ExternalOperations
Public NotInheritable Class Utils
Private Sub New()
End Sub
Public Shared Function CreateDataSource(itemCount As Integer) As IEnumerable
Dim items As New BindingList(Of Item)()
Dim r As New Random()
Dim now As DateTime = DateTime.Now
For i As Integer = 0 To itemCount - 1
Dim item As New Item() With {
.A = "a" & r.[Next](100),
.B = "b" & r.[Next](100),
.DateField = now.AddDays(r.[Next](100)).[Date],
.IntField = r.[Next](200),
.FloatField = CSng(r.NextDouble() * r.[Next](1000)),
.DoubleField = r.NextDouble() * r.[Next](1000),
.DecimalField = CDec(r.NextDouble() * r.[Next](1000))
}
items.Add(item)
Next
Dim lcv As New ListCollectionView(items)
Return lcv
End Function
End Class
End Namespace