3
如何將接受回調函數的現有異步方法作爲參數包裝進任務並行庫兼容方法?將現有的異步方法包裝爲TPL兼容方法
// Existing method
void DoAsync(Action<string> callback) {
...
}
// The desired method should have similar prototype
Task<string> DoAsync() {
// Internally this method should call existing
// version of DoAsync method (see above)
}
謝謝,究竟需要什麼,看起來相當不錯! – sam 2012-01-09 17:21:26