Background tasks being stuff that involves network I/O, disk I/O, or other long-running tasks that may or may not take place over a network. It will often intermix with code that updates the GUI, which needs to be running on another thread, the GUI thread.
Simple meaning that when opening a Form.cs file, the source code is as easy or easier to read than before. In practice, the flow of the source code must still read sequentially with regards to the order in which the code is executed, regardless of which thread it executes on. All the supporting fabric must be reusable and hidden away somewhere, rather than being included in each Form.
Googling MSDN: found that the solution officially sanctioned by Microsoft is the System.ComponentModel.BackgroundWorker, which falls (very!) short on the second point.
(There's also an officially sanctioned Silverlight/XAML/3.5 solution model in System.Windows.Threading.Dispatcher.)
If you really don't like BackgroundWorker, you could create your own base class for background actions, as I did here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With