I see that BackgroundWorker class able to pass to upper process some progress information. I have static method:
MyClass.MyMethod(string, string) // Does some work which progress I need to report
how can I use such method from any calling function or process to return BackgroundWorker progress info like this for example:
backgroundWorker.ReportProgress(percent, "Stage N 1...");
?
First set the
WorkerReportsProgressproperty to True.Than add an event handler to the Progress changed event
and at least add your code into the new handler.
for example:
But at least: The Background worker class is more or less Obsolete ( Windows statement ) i would like to use the new Task class