I am writing a ClassLibrary which will Read a MemoryStream and again on the next Method it will Write to Another MemoryStream..
What I am trying to do is to provide "something" which will Handle Progress Events while performing both the Reading and Writing loops…
the Reading and Writing are not handled by the Form..
So, there is no way of updating the ProgressBar during reading
I am not sure where to start..
So I am asking for some suggestions and explanation!
Have you looked at the
BackgroundWorkerclass yet? You could wrap your read/write functionality in aBackgroundWorkerand devise a way to raise aProgressChangedevent (every so many bytes read/written, etc.). Your form (UI) can subscribe to theOnProgressChangedevent that would update the progress of a progress bar or something.EDIT: This is a very generalized description of the actual work you would need to complete. But all of the tiny things needed to set up an asynchronous background worker are pretty well explained in the above link. The hardest part for you will be incorporating the reading/writing of
MemoryStreams, and figuring out the calculation of progress.