example for push/pull progression
Opened this issue · 1 comments
hi,
could anyone help me to understand how the progress works ?
the pull/push methods can receive a IProgress object.
this object has a report function, but it wants an integer parameter.
i want something like this:
`Dim tProgress As IProgress(Of Integer) = Nothing
Dim tActProgress As Integer = 0
Using tService As SyncService = New SyncService(New AdbSocket(New IPEndPoint(IPAddress.Loopback, AdbClient.AdbServerPort)), tWorkerArgs.QuestDevice)
Using tStream As Stream = File.OpenWrite(tAPKDestFullPath)
tService.Pull(tAPKSourceFullPath, tStream, tProgress, CancellationToken.None)
While tActProgress < 100
tProgress.Report(tActProgress)
SimpleWait(1)
End While
End Using
End Using`
would be nice if anyone could help me
I don't know much the VB.NET syntax so you gotta convert a bit from C# here but basically you create and initialize an IProgress<T>
object, with T as the type of progress (in this case, int
- Integer
in VB.NET-) and assign a method to the EventHandler
.
Then, when you call a method and you give it the IProgress<int>
, every time the progress changes, the method you assigned will be called with the progress as a parameter.
Hope this helps!