How to get notification that a System.Threading.Tasks.Task has completed

前端 未结 6 593
广开言路
广开言路 2020-12-14 15:14

I am currently replacing some home baked task functionality with a new implementation using the new System.Threading.Tasks functionality found in .net 4.

I have a sl

6条回答
  •  再見小時候
    2020-12-14 15:35

    I suspect you're looking for Task.ContinueWith (or Task.ContinueWith). These basically say, "When you've finished this task, execute this action." However, there are various options you can specify to take more control over it.

    MSDN goes into a lot more detail on this in "How to: Chain Multiple Tasks With Continuations" and "Continuation Tasks".

提交回复
热议问题