public void Pause() { _taskExecutor.ExecuteAsync(token => { // "OnPause" event will be fired by the directory watcher _directoryChangeWatcher.Pause(); }); }
public static T ExecuteAndWait <T>(this ITaskQueue queue, Func <CancellationToken, T> task) { var result = default(T); var e = new ManualResetEvent(false); queue.ExecuteAsync(token => { result = task(token); e.Set(); }); e.WaitOne(); Invariants.Assert(result != null); return(result); }
public void Refresh() { _stateChangeTaskQueue.ExecuteAsync(token => { _fileSystemSnapshotManager.Refresh(); }); }