Asynchronous programming design pattern

后端 未结 4 932
失恋的感觉
失恋的感觉 2021-02-10 23:02

I\'m working on a little technical framework for CF.NET and my question is, how should I code the asynchronous part? Read many things on MSDN but isn\'t clear for me.

So

4条回答
  •  囚心锁ツ
    2021-02-10 23:59

    If you want to run piece of code asynchronously, you should use BackgroundWorker. Unless of course, the code you are calling doesn't support asynchronous operation natively. Just like Read/Write methods or service calls.

    If you want to notify, that the asynchronous operation has finished, use delegate or event callback.

提交回复
热议问题