天天看點

重新想象 Windows 8 Store Apps (45) - 多線程之異步程式設計: IAsyncAction, IAsyncOperation, IAsyncActionWithProgress, IAsyncOperationWithProgress

<a href="http://files.cnblogs.com/webabcd/Windows8.rar">[源碼下載下傳]</a>

重新想象 Windows 8 Store Apps (45) - 多線程之異步程式設計: IAsyncAction, IAsyncOperation, IAsyncActionWithProgress, IAsyncOperationWithProgress

介紹

重新想象 Windows 8 Store Apps 之 異步程式設計

IAsyncAction - 無傳回值,無進度值

IAsyncOperation - 有傳回值,無進度值

IAsyncActionWithProgress - 無傳回值,有進度值

IAsyncOperationWithProgress - 有傳回值,有進度值

示例

1、示範 IAsyncAction(無傳回值,無進度值)的用法

Thread/Async/IAsyncActionDemo.xaml

Thread/Async/IAsyncActionDemo.xaml.cs

2、示範 IAsyncOperation&lt;TResult&gt;(有傳回值,無進度值)的用法

Thread/Async/IAsyncOperationDemo.xaml

Thread/Async/IAsyncOperationDemo.xaml.cs

3、示範 IAsyncActionWithProgress&lt;TProgress&gt;(無傳回值,有進度值)的用法

Thread/Async/IAsyncActionWithProgressDemo.xaml

Thread/Async/IAsyncActionWithProgressDemo.xaml.cs

4、示範 IAsyncOperationWithProgress&lt;TResult, TProgress&gt;(有傳回值,有進度值)的用法

Thread/Async/IAsyncOperationWithProgressDemo.xaml

Thread/Async/IAsyncOperationWithProgressDemo.xaml.cs

OK

繼續閱讀