Пример #1
0
 private static void PreserveCultureUnsafeOnCompleted(ICriticalNotifyCompletion notifier,
                                                      Action continuation,
                                                      bool useSyncContext) {
   // Rely on the SyncContext to preserve culture if it exists
   if (useSyncContext && SynchronizationContext.Current != null) {
     notifier.UnsafeOnCompleted(continuation);
   } else {
     var preservedCulture = TaskAsyncHelper.SaveCulture();
     notifier.UnsafeOnCompleted(() => {
       TaskAsyncHelper.RunWithPreservedCulture(preservedCulture, continuation);
     });
   }
 }
Пример #2
0
 public void UnsafeOnCompleted(Action continuation)
 {
     _criticalNotifyCompletion.UnsafeOnCompleted(continuation);
 }