Project Name File Name Usage Source Code Link
soundfingerprinting ReportViewModel.cs Task.Factory.StartNew( () => { MoveDuplicatesToFolder(selectedPath); _isMoving = false; Process.Start("explorer.exe", selectedPath); }) .ContinueWith((task) => CommandManager.InvalidateRequerySuggested(), TaskScheduler.FromCurrentSynchronizationContext()) Link To Source File
LoreSoft.Shared TaskExtensions.cs // Delay a continuation to run the action factory .StartNewDelayed(dueTime, cancellationToken) .ContinueWith(t => { if (t.IsCanceled) { result.TrySetCanceled(); return; } try { action(state); result.TrySetResult(null); } catch (Exception ex) { result.TrySetException(ex); } }, scheduler) Link To Source File
Channel9Downloader CategoriesVM.cs task.ContinueWith( x => { _seriesSelectionVM = _dependencyComposer.GetExportedValue(); _seriesSelectionVM.Initialize(categories.Series, TextFilter); _showSelectionVM = _dependencyComposer.GetExportedValue(); _showSelectionVM.Initialize(categories.Shows, TextFilter); _tagSelectionVM = _dependencyComposer.GetExportedValue(); _tagSelectionVM.Initialize(categories.Tags, TextFilter); CurrentContent = _tagSelectionVM; IsAdornerVisible = false; CommandManager.InvalidateRequerySuggested(); }, continuationTaskScheduler) Link To Source File
Channel9Downloader DownloadsVM.cs task.ContinueWith( p => { IsAdornerVisible = false; CommandManager.InvalidateRequerySuggested(); }, continuationTaskScheduler) Link To Source File
Channel9Downloader DownloadsVM.cs task.ContinueWith( p => { IsAdornerVisible = false; CommandManager.InvalidateRequerySuggested(); }, _mainThreadTaskScheduler) Link To Source File
nuget PackageRestoreManager.cs task.ContinueWith(originalTask => { if (originalTask.IsFaulted) { ExceptionHelper.WriteToActivityLog(originalTask.Exception); } else { // we don't allow canceling Debug.Assert(!originalTask.IsCanceled); // after we're done with restoring packages, do the check again CheckForMissingPackages(); } }, uiScheduler) Link To Source File
SwarmIntelligence TaskExtensions.cs task.ContinueWith(delegate { if(task.IsFaulted) tcs.TrySetException(task.Exception.InnerExceptions); else if(task.IsCanceled) tcs.TrySetCanceled(); else try { next(); tcs.TrySetResult(null); } catch(Exception exc) { tcs.TrySetException(exc); } }, TaskScheduler.Default) Link To Source File
SwarmIntelligence TaskExtensions.cs task.ContinueWith(delegate { if(task.IsFaulted) tcs.TrySetException(task.Exception.InnerExceptions); else if(task.IsCanceled) tcs.TrySetCanceled(); else try { TResult result = next(); tcs.TrySetResult(result); } catch(Exception exc) { tcs.TrySetException(exc); } }, TaskScheduler.Default) Link To Source File
SwarmIntelligence TaskExtensions.cs task.ContinueWith(delegate { // When the first task completes, if it faulted or was canceled, bail if(task.IsFaulted) tcs.TrySetException(task.Exception.InnerExceptions); else if(task.IsCanceled) tcs.TrySetCanceled(); else // Otherwise, get the next task. If it's null, bail. If not, // when it's done we'll have our result. try { next().ContinueWith(t => tcs.TrySetFromTask(t), TaskScheduler.Default); } catch(Exception exc) { tcs.TrySetException(exc); } }, TaskScheduler.Default) Link To Source File
SwarmIntelligence TaskExtensions.cs task.ContinueWith(delegate { // When the first task completes, if it faulted or was canceled, bail if(task.IsFaulted) tcs.TrySetException(task.Exception.InnerExceptions); else if(task.IsCanceled) tcs.TrySetCanceled(); else // Otherwise, get the next task. If it's null, bail. If not, // when it's done we'll have our result. try { next().ContinueWith(t => tcs.TrySetFromTask(t), TaskScheduler.Default); } catch(Exception exc) { tcs.TrySetException(exc); } }, TaskScheduler.Default) Link To Source File
NugetCracker PackageRestoreManager.cs task.ContinueWith(originalTask => { if (originalTask.IsFaulted) { ExceptionHelper.WriteToActivityLog(originalTask.Exception); } else { // we don't allow canceling Debug.Assert(!originalTask.IsCanceled); // after we're done with restoring packages, do the check again CheckForMissingPackages(); } }, uiScheduler) Link To Source File
Dominion Simulation.cs Task.Factory .ContinueWhenAll(tasks, WriteResults) .ContinueWith(onDone, syncContext) Link To Source File
WCell TaskFactoryExtensions.cs // Delay a continuation to run the action factory .StartNewDelayed(millisecondsDelay, cancellationToken) .ContinueWith(t => { if (t.IsCanceled) result.TrySetCanceled(); else { try { action(state); } catch (Exception exc) { result.TrySetException(exc); } finally { result.TrySetResult(null); if (result.Task.Status == TaskStatus.RanToCompletion) { result.Task.Dispose(); } } } }, scheduler) Link To Source File