????????????????????????EMP??
???????????? ???????[ 2013/4/7 10:23:29 ] ????????
?????????????????????“.NET1.0?л???IAsyncResult????????????????APM??”???????System.Threading??????????????????????ó???????????Ч???????Щ??????????з????????????????????顣????????????????ó???BackgroundWorker????????????????????????????????????ó????????????????????????????????????
??????????????????????????
????1??????к????????
????2????y????????????????
????3?????????????????
????4??????????????????????
????5????????????????ж????????????????楨??????????????????????????????????
????????????????????????????????????????????????????
????AsyncOperationManager??AsyncOperation
????AsyncOperationManager???AsyncOperation????System.ComponentModel??????????????????????????????????????????????????????????????У?????????????????????????ó??????????? ASP.NET?????????ó???? Windows ??????ó????????“??????????”??????????????????
????AsyncOperationManager???AsyncOperation???API???£?
// ?????????????????????????????????????С?
public static class AsyncOperationManager
{
// ???????????????????????????????
public static SynchronizationContext SynchronizationContext { get; set; }
// ?????????????????????????????и????AsyncOperation????
// ????:userSuppliedState:
// ?????????????????????????????? ID???????????????????????
public static AsyncOperation CreateOperation(object userSuppliedState)
{
return AsyncOperation.CreateOperation(userSuppliedState??SynchronizationContext);
}
}
// ???????????????????
public sealed class AsyncOperation
{
// ??????
private AsyncOperation(object userSuppliedState?? SynchronizationContext syncContext);
internal static AsyncOperation CreateOperation(object userSuppliedState
?? SynchronizationContext syncContext);
// ????????????????SynchronizationContext????
public SynchronizationContext SynchronizationContext { get; }
// ??????????????????????????
public object UserSuppliedState { get; }
// ???????ó?????????????????????е?????С?
public void Post(SendOrPostCallback d?? object arg);
// ???????????????????
public void OperationCompleted();
// Ч??????? Post() + OperationCompleted() ???????
public void PostOperationCompleted(SendOrPostCallback d?? object arg);
}
?????????????????????????
????1??AsyncOperationManager???????????????????????????С???????????л???“????????? Object ????”????С?????????????????? sealed ??????
????2??AsyncOperationManager??????????????????????????????????????????? .NET Framework ??????????ó????????
????3??AsyncOperation?????????????????????????и???????????????????????????????????????????????????·????????????????????????????????????????????AsyncOperation?? Post() ??????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11