Project Name File Name Usage Source Code Link
WcfHttpMvcFormsAuth WebQueryProvider.cs this.client.SendAsync(requestMessage).ContinueWith(task => { try { if (task.IsFaulted) { tcs.TrySetException(task.Exception.GetBaseException()); return; } if (task.IsCanceled) { tcs.TrySetCanceled(); return; } HttpResponseMessage response = task.Result; if (response == null) { tcs.TrySetResult(null); return; } IEnumerable results = Deserialize(response); tcs.TrySetResult(results); } catch (Exception e) { tcs.TrySetException(e); } }) Link To Source File
Loam Massive.cs task.ContinueWith(x => callback.Invoke(x.Result.ToExpandoList(Projection))) Link To Source File
Oak Massive.cs task.ContinueWith(x => callback.Invoke(x.Result.ToExpandoList(Projection))) Link To Source File
Restful Massive.cs task.ContinueWith(x => callback.Invoke(x.Result.ToExpandoList(Projection))) Link To Source File
AL-Redis RedisBucket.cs returnHandle.ContinueWith(t => { cb(t.Result, t.Exception); }) Link To Source File
AL-Redis RedisBucket.cs returnHandle.ContinueWith(t => { cb(t.Result, t.Exception); }) Link To Source File
PrintChar OnlineDataFetcher.cs _repository.ContinueWith(repo => whatToDo(repo.Result)) Link To Source File
PrintChar CompendiumClient.cs loginResponse.ContinueWith(task => _FinishLogin(task.Result, username)) Link To Source File
CouchDude ReplicatorApi.cs replicatorDbApi.Query(new ViewQuery{ ViewName = "_all_docs"}).ContinueWith( t => t.Result.Rows.Select(row => row.DocumentId).Where(docId => !docId.StartsWith("_design/")) ) Link To Source File
CouchDude DatabaseManagementAndReplication.cs requestDescriptor().ContinueWith( t => { if (t.Result == null || t.Result.ReplicationState == ReplicationState.Triggered || t.Result.ReplicationState == ReplicationState.None) WatchForReplicationToFinish(requestDescriptor, replicationDoneEvent); else if(t.Result.ReplicationState == ReplicationState.Error) throw new Exception("Replication error occured"); else if (t.Result.ReplicationState == ReplicationState.Completed) replicationDoneEvent.Set(); }) Link To Source File
practice CategoryTableViewSource.cs task.ContinueWith(t => { this._data = task.Result; callback(); }) Link To Source File
practice ProductTableViewSource.cs task.ContinueWith((t) => { this._data = t.Result; callback(); }) Link To Source File
libdelugeclient-sharp DelugeClient.cs Task.Factory.StartNew (() => DoServiceCall (method, parameters)).ContinueWith (task => { if (callback != null) callback (task.Result); }) Link To Source File
libdelugeclient-sharp DelugeClient.cs Task.Factory.StartNew (() => Login (password)).ContinueWith (task => callback (task.Result)) Link To Source File
libdelugeclient-sharp DelugeClient.cs Task.Factory.StartNew (() => ListMethods ()).ContinueWith (task => callback (task.Result)) Link To Source File
libdelugeclient-sharp DelugeClient.cs Task.Factory.StartNew (() => GetTorrents ()).ContinueWith (task => callback (task.Result)) Link To Source File
libdelugeclient-sharp DelugeClient.cs Task.Factory.StartNew (() => GetAvailablePlugins ()).ContinueWith (task => callback (task.Result)) Link To Source File
ILoveLucene SourceStorage.cs _source.GetItems() .ContinueWith(task => IndexItems(_source, task.Result)) Link To Source File
somerset DownloadCommand.cs Task.Factory.StartNew(() => WebClient.FetchWebPageContent(details.ScorecardUrl)) .ContinueWith(t => SaveScorecard(details, t, dataStore)) Link To Source File
WCFQuickSamples Program.cs AsyncMethod().ContinueWith(task => { tcs.SetResult(task.Result); }) Link To Source File
Lokad.Cloud TaskFactoryExtensions.cs task.ContinueWith(t => { TimeSpan delay; if (!shouldRetry(trial, t.Exception, out delay)) { completionSource.TrySetException(t.Exception.InnerExceptions); } else { StartAsyncDelay(delay, null, cancellationToken) .ContinueWith(delayTask => { if (delayTask.IsCanceled) { completionSource.TrySetCanceled(); } else { RetryInternalWithResult(factory, taskProvider, completionSource, cancellationToken, shouldRetry, trial + 1); } }); } }, TaskContinuationOptions.OnlyOnFaulted) Link To Source File
GothicCheckers AIEngine.cs _task.ContinueWith(task => { BestMove = task.Result; Dispatcher.BeginInvoke((Action)OnBestMoveChosen, null); }) Link To Source File
coapp HttpServer.cs Task.Factory.FromAsync(_listener.BeginGetContext, _listener.EndGetContext, _listener).ContinueWith( (antecedent) => { Start(); // start a new listener. try { var request = antecedent.Result.Request; var response = antecedent.Result.Response; var lp = GetLocalPath(request.Url); switch( request.HttpMethod ) { case "HEAD": if (Exists(lp)) { response.AddHeader("Last-Modified", GetLocationLastModified(lp).ToString("r")); response.ContentLength64 = GetContentLength(lp); } else { response.StatusCode = (int)HttpStatusCode.NotFound; } response.Close(); break; case "GET": if (!Exists(lp)) { response.StatusCode = (int)HttpStatusCode.NotFound; response.Close(); break; } response.AddHeader("Last-Modified", GetLocationLastModified(lp).ToString("r")); response.ContentLength64 = GetContentLength(lp); if( Directory.Exists(lp)) { response.ContentType = "text/html"; var buf = GetDirectoryListing(lp).ToByteArray(); response.OutputStream.Write(buf,0,buf.Length); response.OutputStream.Flush(); response.Close(); break; } var data = File.ReadAllBytes(lp); response.OutputStream.Write(data, 0, data.Length); response.Close(); break; case "POST": break; default: Console.WriteLine("Unknown HTTP VERB : {0}", request.HttpMethod ); break; } } catch( Exception e) { Console.WriteLine("HTTP Server Error: {0}",e.Message); } }, TaskContinuationOptions.AttachedToParent) Link To Source File
coapp RemoteFile.cs Task.Factory.FromAsync(webRequest.BeginGetResponse, (Func)webRequest.BetterEndGetResponse , this).ContinueWith(asyncResult => { if (messages != null) { messages.Register(); } try { if (IsCancelled) { _cancel(); } var httpWebResponse = asyncResult.Result as HttpWebResponse; _lastStatus = httpWebResponse.StatusCode; if (httpWebResponse.StatusCode == HttpStatusCode.OK) { _lastModified = httpWebResponse.LastModified; _contentLength = httpWebResponse.ContentLength; ActualRemoteLocation = httpWebResponse.ResponseUri; if (IsCancelled) { _cancel(); } if (string.IsNullOrEmpty(_filename)) { _filename = httpWebResponse.ContentDispositionFilename(); if (string.IsNullOrEmpty(_filename)) { _filename = ActualRemoteLocation.LocalPath.Substring(ActualRemoteLocation.LocalPath.LastIndexOf('/') + 1); if (string.IsNullOrEmpty(_filename) || ServerSideExtensions.Contains(Path.GetExtension(_filename))) { ActualRemoteLocation.GetLeftPart(UriPartial.Path).MakeSafeFileName(); } } } try { if( Filename.FileIsLocalAndExists() ) { var md5 = string.Empty; try { if (httpWebResponse.Headers.AllKeys.ContainsIgnoreCase("x-ms-meta-MD5")) { // it's coming from azure, check the value of the md5 and compare against the file on disk ... better than date/size matching. md5 = httpWebResponse.Headers["x-ms-meta-MD5"].Trim(); } else if (httpWebResponse.Headers.AllKeys.ContainsIgnoreCase("Content-MD5")) { md5 = httpWebResponse.Headers["Content-MD5"].Trim(); if (md5.EndsWith("=")) { md5 = Convert.FromBase64CharArray(md5.ToCharArray(), 0, md5.Length).ToUtf8String(); } } } catch { // something gone screwy? } if( !string.IsNullOrEmpty(md5) ) { var localMD5 = string.Empty; using( var stream = new FileStream(Filename, FileMode.Open, FileAccess.Read, FileShare.Read) ) { localMD5 = MD5.Create().ComputeHash(stream).ToHexString(); } if( string.Equals(md5, localMD5, StringComparison.CurrentCultureIgnoreCase)) { // it's the same file. We're not doin nothing. RemoteFileMessages.Invoke.Completed(RemoteLocation); return; } // only do the size/date comparison if the server doesn't provide an MD5 } else if (_contentLength > 0 && _lastModified.CompareTo(File.GetCreationTime(Filename)) <= 0 && _contentLength == new FileInfo(Filename).Length) { // file is identical to the one on disk. // we're not going to reget it. :p RemoteFileMessages.Invoke.Completed(RemoteLocation); return; } } // we should open the file here, so that it's ready when we start the async read cycle. if (_filestream != null) { throw new CoAppException("THIS VERY BAD AND UNEXPECTED. (Failed to close?)"); } _filestream = File.Open(Filename, FileMode.Create); if (IsCancelled) { _cancel(); return; } var tcs = new TaskCompletionSource(TaskCreationOptions.AttachedToParent); tcs.Iterate(AsyncReadImpl(tcs, httpWebResponse)); return; } catch { // failed to actually create the file, or some other catastrophic failure. _cancel(); return; } } // this is not good. RemoteFileMessages.Invoke.Failed(RemoteLocation); } catch (AggregateException e) { RemoteFileMessages.Invoke.Failed(RemoteLocation); // at this point, we've failed somehow if (_lastStatus == HttpStatusCode.NotImplemented) { // we never got started. Probably not found. } var ee = e.Flatten(); foreach (var ex in ee.InnerExceptions) { var wex = ex as WebException; if( wex != null ) { Console.WriteLine("Status:" + wex.Status); Console.WriteLine("Response:" + wex.Response); Console.WriteLine("Response:" + ((HttpWebResponse)wex.Response).StatusCode); } Console.WriteLine(ex.GetType()); Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } } catch (Exception e) { Console.WriteLine(e.GetType()); Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); } }, TaskContinuationOptions.AttachedToParent) Link To Source File
coapp Installer.cs packageManager.GetPackages(SpecifiedPackage.Name + "-*-" +SpecifiedPackage.Architecture + "-"+SpecifiedPackage.PublicKeyToken , latest: true, forceScan: true, messages: _messages).ContinueWith((antecedent) => { if (antecedent.IsFaulted || antecedent.Result.IsNullOrEmpty()) { UpgradedPackage = null; // DOERROR OnReady(); return; } packageManager.GetPackageDetails(antecedent.Result.FirstOrDefault().CanonicalName, _messages).ContinueWith((antecedent2) => { if (antecedent.IsFaulted || antecedent.Result.IsNullOrEmpty()) { OnReady(); // DOERROR return; } try { UpgradedPackage = antecedent.Result.FirstOrDefault(); ExtractTrickyPackageInfo(); } catch { } OnPropertyChanged(); OnReady(); }, TaskContinuationOptions.AttachedToParent); }, TaskContinuationOptions.AttachedToParent) Link To Source File
coapp Installer.cs packageManager.GetPackages(Path.GetFullPath(MsiFilename), latest: false, messages: _messages).ContinueWith((antecedent) => { if (antecedent.IsFaulted || antecedent.Result.IsNullOrEmpty() ) { // DOERROR OnReady(); return; } packageManager.GetPackageDetails(antecedent.Result.FirstOrDefault().CanonicalName, _messages).ContinueWith((antecedent2) => { if (antecedent.IsFaulted || antecedent.Result.IsNullOrEmpty()) { OnReady(); // DOERROR return; } try { SpecifiedPackage = antecedent.Result.FirstOrDefault(); ExtractTrickyPackageInfo(); } catch { } ProbeForNewerPackageInfo(); OnPropertyChanged(); OnReady(); }, TaskContinuationOptions.AttachedToParent); }, TaskContinuationOptions.AttachedToParent) Link To Source File
coapp EngineService.cs serverPipe.ReadAsync(serverInput, 0, serverInput.Length).AutoManage().ContinueWith(antecedent => { var rawMessage = Encoding.UTF8.GetString(serverInput, 0, antecedent.Result); if (string.IsNullOrEmpty(rawMessage)) { return; } var requestMessage = new UrlEncodedMessage(rawMessage); // first command must be "startsession" if (!requestMessage.Command.Equals("start-session", StringComparison.CurrentCultureIgnoreCase)) { return; } // verify that user is allowed to connect. try { var hasAccess = false; serverPipe.RunAsClient(() => { hasAccess = PermissionPolicy.Connect.HasPermission; }); if (!hasAccess) return; } catch { return; } // check for the required parameters. // close the session if they are not here. if (string.IsNullOrEmpty(requestMessage["id"]) || string.IsNullOrEmpty(requestMessage.Data["client"])) { return; } var isAsync = (bool?) requestMessage["async"]; if (isAsync.HasValue && isAsync.Value == false) { StartResponsePipeAndProcessMesages(requestMessage.Data["client"], requestMessage["id"], serverPipe); } else { Session.Start(requestMessage.Data["client"], requestMessage["id"], serverPipe, serverPipe); } }) Link To Source File
coapp PackageFeed.cs Recognizer.Recognize(location).ContinueWith(antecedent => { var info = antecedent.Result; PackageFeed result = null; string locationKey = null; if (info.IsPackageFeed) { if (info.IsFolder) { locationKey = Path.Combine(info.FullPath, info.Filter ); if (_allFeeds.ContainsKey(locationKey)) { return _allFeeds[locationKey]; } result = new DirectoryPackageFeed(info.FullPath, info.Filter); } else if (info.IsFile) { if (_allFeeds.ContainsKey(info.FullPath)) { return _allFeeds[info.FullPath]; } if (info.IsAtom) { result = new AtomPackageFeed(info.FullPath); } /* if (info.IsArchive) { result = new ArchivePackageFeed(info.FullPath); } * */ } // TODO: URL based feeds else if (info.IsURL) { if (_allFeeds.ContainsKey(info.FullUrl.AbsoluteUri)) { return _allFeeds[info.FullUrl.AbsoluteUri]; } if (info.IsAtom) { result = new AtomPackageFeed(info.FullUrl); } } } else if(info.IsPackageFile) { // SessionPackageFeed.Instance.Add(Package.GetPackageFromFilename(info.FullPath)); result = new DirectoryPackageFeed(Path.GetDirectoryName(info.FullPath),Path.GetFileName(info.FullPath)); // Hack of the day: // Since, I have to look up this file as a feed again later, based on the original path (likely, an http:// location) // we have to forcably set the location in the feed itself to reflect this. result.Location = location; locationKey = location; } if (result != null) { result.RecognitionInfo = info; lock (_allFeeds) { if (!_allFeeds.ContainsKey(locationKey ?? result.Location)) { _allFeeds.Add(locationKey ?? result.Location, result); } else { result = _allFeeds[locationKey ?? result.Location]; } // GS01: TODO: This is a crappy way of avoiding a deadlock when the same feed has been requested twice by two different threads. } } return result; }, TaskContinuationOptions.AttachedToParent ) Link To Source File
coapp NewPackageManager.cs PackageFeed.GetPackageFeedFromLocation(feedLocation).ContinueWith(antecedent => { if (antecedent.Result != null) { Cache.Value[feedLocation] = antecedent.Result; } else { LogMessage("Feed {0} was unable to load.", feedLocation); } }, TaskContinuationOptions.AttachedToParent) Link To Source File
coapp NewPackageManager.cs // add feed to the session feeds. PackageFeed.GetPackageFeedFromLocation(location).ContinueWith(antecedent => { var foundFeed = antecedent.Result; if (foundFeed != null) { if (foundFeed != SessionPackageFeed.Instance || foundFeed != InstalledPackageFeed.Instance ) { SessionCache.Value[location] = foundFeed; } } else { PackageManagerMessages.Invoke.Error("add-feed", "location", "failed to recognize location '{0}' as a valid package feed".format(location)); LogMessage("Feed {0} was unable to load.", location); } }, TaskContinuationOptions.AttachedToParent) Link To Source File
coapp NewPackageManager.cs // add feed to the system feeds. PackageFeed.GetPackageFeedFromLocation(location).ContinueWith(antecedent => { var foundFeed = antecedent.Result; if (foundFeed != null) { if (foundFeed != SessionPackageFeed.Instance || foundFeed != InstalledPackageFeed.Instance) { Cache.Value[location] = foundFeed; } } else { PackageManagerMessages.Invoke.Error("add-feed", "location", "failed to recognize location '{0}' as a valid package feed".format(location)); LogMessage("Feed {0} was unable to load.", location); } }, TaskContinuationOptions.AttachedToParent) Link To Source File
coapp NewPackageManager.cs // otherwise, we'll call the recognizer Recognizer.Recognize(location).ContinueWith(antecedent => { if (antecedent.IsFaulted) { PackageManagerMessages.Invoke.FileNotRecognized(location, "Unexpected error recognizing file."); return; } if (antecedent.Result.IsPackageFile) { var package = Package.GetPackageFromFilename(location); // mark it download 100% package.PackageSessionData.DownloadProgress = 100; SessionPackageFeed.Instance.Add(package); PackageManagerMessages.Invoke.PackageInformation(package, Enumerable.Empty()); PackageManagerMessages.Invoke.Recognized(localLocation); return; } if (antecedent.Result.IsPackageFeed) { PackageManagerMessages.Invoke.FeedAdded(location); PackageManagerMessages.Invoke.Recognized(location); } // if this isn't a package file, then there is something odd going on here. // we don't accept non-package files willy-nilly. PackageManagerMessages.Invoke.FileNotRecognized(location, "File isn't a package, and doesn't appear to have been requested. "); return; }, TaskContinuationOptions.AttachedToParent) Link To Source File
coapp PackageCollectionExtensions.cs PackageFeed.GetPackageFeedFromLocation(feedLocation).ContinueWith(antecedent => { if (antecedent.Result != null) { if ( (from feed in feedCollection where feed.Location.Equals(feedLocation, StringComparison.CurrentCultureIgnoreCase) select feed).Count() == 0) { feedCollection.Add(antecedent.Result); } } }, TaskContinuationOptions.AttachedToParent ) Link To Source File
coapp Session.cs readTask.ContinueWith(antecedent => { if (antecedent.IsFaulted || antecedent.IsCanceled || !_serverPipe.IsConnected) { Disconnect(); return; } if (antecedent.Result >= EngineService.BufferSize) { SendUnexpectedFailure(new CoAppException("Message size exceeds maximum size allowed.")); return; } var rawMessage = Encoding.UTF8.GetString(serverInput, 0, antecedent.Result); if (string.IsNullOrEmpty(rawMessage)) { return; } var requestMessage = new UrlEncodedMessage(rawMessage); var rqid = requestMessage["rqid"].ToString(); // create a request cache. new RequestCacheMessages().Register(); var dispatchTask = Dispatch(requestMessage); if (!string.IsNullOrEmpty(rqid)) { if (dispatchTask == null) { // completed synchronously. WriteAsync(new UrlEncodedMessage("task-complete") {{ "rqid", rqid } }); } else { dispatchTask.ContinueWith(dispatchAntecedent => { try { // had to force this to ensure that async writes are at least in the pipe // before waiting on the pipe drain. // without this, it is possible that the async writes are still 'getting to the pipe' // and not actually in the pipe, **even though the async write is complete** Thread.Sleep(50); if (_responsePipe != null) { _responsePipe.WaitForPipeDrain(); WriteAsync(new UrlEncodedMessage("task-complete") { { "rqid", rqid } }); } } catch (Exception e) { Logger.Error(e); // supress any exceptions. } }); } } WriteErrorsOnException(dispatchTask); // readTask = null; }) Link To Source File
devtools CommitMessageHandler.cs Bitly.Shorten(url).ContinueWith( (bitlyAntecedent) => { var commitUrl = bitlyAntecedent.Result; var handle = _aliases.ContainsKey(username) ? _aliases[username] : username; var sz = repository.Length + handle.Length + commitUrl.Length + commitMessage.Length + 10; var n = 140 - sz; if (n < 0) { commitMessage = commitMessage.Substring(0, (commitMessage.Length + n) - 3) + "..."; } _tweeter.Tweet("[{0}]=>{1} via {2} {3}", repository, commitMessage, handle, commitUrl); Console.WriteLine("[{0}]=>{1} via {2} {3}", repository, commitMessage, handle, commitUrl); }) Link To Source File
devtools Listener.cs _current.ContinueWith(antecedent => { if( antecedent.IsCanceled || antecedent.IsFaulted ) { _current = null; return; } Start(); // start a new listener. try { var request = antecedent.Result.Request; var response = antecedent.Result.Response; var url = request.Url; var path = url.AbsolutePath.ToLower(); var handlerKey = _paths.Keys.OrderByDescending(each => each.Length).Where(path.StartsWith).FirstOrDefault(); if (handlerKey == null) { // no handler response.StatusCode = 404; response.Close(); return; } var relativePath = path.Substring(handlerKey.Length); if( string.IsNullOrEmpty(relativePath) ) { relativePath = "index"; } var handler = _paths[handlerKey]; Task handlerTask = null; var length = request.ContentLength64; switch (request.HttpMethod) { case "PUT": try { var putData = new byte[length]; var read = 0; var offset = 0; do { read = request.InputStream.Read(putData, offset, (int)length-offset); offset += read; } while (read > 0 && offset < length); handlerTask = handler.Put(response,relativePath, putData); } catch (Exception e) { Console.WriteLine("{0} -- {1}/r/n{2}", e.GetType(), e.Message, e.StackTrace); response.StatusCode = 500; response.Close(); } break; case "HEAD": try { handlerTask = handler.Head(response, relativePath, new UrlEncodedMessage(relativePath + "?" + url.Query)); } catch (Exception e) { Console.WriteLine("{0} -- {1}/r/n{2}", e.GetType(), e.Message, e.StackTrace); response.StatusCode = 500; response.Close(); } break; case "GET": try { handlerTask = handler.Get(response, relativePath, new UrlEncodedMessage(relativePath + "?" + url.Query)); } catch (Exception e) { Console.WriteLine("{0} -- {1}/r/n{2}", e.GetType(), e.Message, e.StackTrace); response.StatusCode = 500; response.Close(); } break; case "POST": try { var postData = new byte[length]; var read = 0; var offset = 0; do { read = request.InputStream.Read(postData, offset, (int)length - offset); offset += read; } while (read > 0 && offset < length); handlerTask = handler.Post(response, relativePath, new UrlEncodedMessage(relativePath + "?" + Encoding.UTF8.GetString(postData))); } catch (Exception e) { Console.WriteLine("{0} -- {1}/r/n{2}", e.GetType(), e.Message, e.StackTrace); response.StatusCode = 500; response.Close(); } break; } if (handlerTask != null) { handlerTask.ContinueWith( (antecedent2) => { if (antecedent2.IsFaulted && antecedent2.Exception != null) { var e = antecedent2.Exception.InnerException; Console.WriteLine("{0} -- {1}/r/n{2}", e.GetType(), e.Message, e.StackTrace); response.StatusCode = 500; } response.Close(); }, TaskContinuationOptions.AttachedToParent); } else { // nothing retured? must be unimplemented. response.StatusCode = 405; response.Close(); } } catch (Exception e) { Console.WriteLine("{0} -- {1}/r/n{2}", e.GetType(), e.Message, e.StackTrace); } }, TaskContinuationOptions.AttachedToParent) Link To Source File
devtools UploadedFileHandler.cs // pkg.Name Bitly.Shorten(location.AbsoluteUri).ContinueWith( (x) => { var name = "[{0}-{1}-{2}]".format(pkg.Name, pkg.Version, pkg.Architecture); var summary = pkg.Summary; var l1 = 138 - (name.Length + x.Result.Length); if( summary.Length > l1 ) { summary = summary.Substring(0, l1 - 1) + "/u2026"; } var text = "{0} {1} {2}".format(name, summary, x.Result); Console.WriteLine("Tweet: {0}",text); _tweeter.Tweet(text); }) Link To Source File
_toolkit_deprecated HttpServer.cs Task.Factory.FromAsync(_listener.BeginGetContext, _listener.EndGetContext, _listener).ContinueWith( (antecedent) => { Start(); // start a new listener. try { var request = antecedent.Result.Request; var response = antecedent.Result.Response; var lp = GetLocalPath(request.Url); switch( request.HttpMethod ) { case "HEAD": if (Exists(lp)) { response.AddHeader("Last-Modified", GetLocationLastModified(lp).ToString("r")); response.ContentLength64 = GetContentLength(lp); } else { response.StatusCode = (int)HttpStatusCode.NotFound; } response.Close(); break; case "GET": if (!Exists(lp)) { response.StatusCode = (int)HttpStatusCode.NotFound; response.Close(); break; } response.AddHeader("Last-Modified", GetLocationLastModified(lp).ToString("r")); response.ContentLength64 = GetContentLength(lp); if( Directory.Exists(lp)) { response.ContentType = "text/html"; var buf = GetDirectoryListing(lp).ToByteArray(); response.OutputStream.Write(buf,0,buf.Length); response.OutputStream.Flush(); response.Close(); break; } var data = File.ReadAllBytes(lp); response.OutputStream.Write(data, 0, data.Length); response.Close(); break; case "POST": break; default: Console.WriteLine("Unknown HTTP VERB : {0}", request.HttpMethod ); break; } } catch( Exception e) { Console.WriteLine("HTTP Server Error: {0}",e.Message); } }, TaskContinuationOptions.AttachedToParent) Link To Source File
_toolkit_deprecated RemoteFile.cs Task.Factory.FromAsync(webRequest.BeginGetResponse, (Func)webRequest.BetterEndGetResponse , this).ContinueWith(asyncResult => { if (messages != null) { messages.Register(); } try { if (IsCancelled) { _cancel(); } var httpWebResponse = asyncResult.Result as HttpWebResponse; _lastStatus = httpWebResponse.StatusCode; if (httpWebResponse.StatusCode == HttpStatusCode.OK) { _lastModified = httpWebResponse.LastModified; _contentLength = httpWebResponse.ContentLength; ActualRemoteLocation = httpWebResponse.ResponseUri; if (IsCancelled) { _cancel(); } if (string.IsNullOrEmpty(_filename)) { _filename = httpWebResponse.ContentDispositionFilename(); if (string.IsNullOrEmpty(_filename)) { _filename = ActualRemoteLocation.LocalPath.Substring(ActualRemoteLocation.LocalPath.LastIndexOf('/') + 1); if (string.IsNullOrEmpty(_filename) || ServerSideExtensions.Contains(Path.GetExtension(_filename))) { ActualRemoteLocation.GetLeftPart(UriPartial.Path).MakeSafeFileName(); } } } try { if( Filename.FileIsLocalAndExists() ) { var md5 = string.Empty; try { if (httpWebResponse.Headers.AllKeys.ContainsIgnoreCase("x-ms-meta-MD5")) { // it's coming from azure, check the value of the md5 and compare against the file on disk ... better than date/size matching. md5 = httpWebResponse.Headers["x-ms-meta-MD5"].Trim(); } else if (httpWebResponse.Headers.AllKeys.ContainsIgnoreCase("Content-MD5")) { md5 = httpWebResponse.Headers["Content-MD5"].Trim(); if (md5.EndsWith("=")) { md5 = Convert.FromBase64CharArray(md5.ToCharArray(), 0, md5.Length).ToUtf8String(); } } } catch { // something gone screwy? } if( !string.IsNullOrEmpty(md5) ) { var localMD5 = string.Empty; using( var stream = new FileStream(Filename, FileMode.Open, FileAccess.Read, FileShare.Read) ) { localMD5 = MD5.Create().ComputeHash(stream).ToHexString(); } if( string.Equals(md5, localMD5, StringComparison.CurrentCultureIgnoreCase)) { // it's the same file. We're not doin nothing. RemoteFileMessages.Invoke.Completed(RemoteLocation); return; } // only do the size/date comparison if the server doesn't provide an MD5 } else if (_contentLength > 0 && _lastModified.CompareTo(File.GetCreationTime(Filename)) <= 0 && _contentLength == new FileInfo(Filename).Length) { // file is identical to the one on disk. // we're not going to reget it. :p RemoteFileMessages.Invoke.Completed(RemoteLocation); return; } } // we should open the file here, so that it's ready when we start the async read cycle. if (_filestream != null) { throw new CoAppException("THIS VERY BAD AND UNEXPECTED. (Failed to close?)"); } _filestream = File.Open(Filename, FileMode.Create); if (IsCancelled) { _cancel(); return; } var tcs = new TaskCompletionSource(TaskCreationOptions.AttachedToParent); tcs.Iterate(AsyncReadImpl(tcs, httpWebResponse)); return; } catch { // failed to actually create the file, or some other catastrophic failure. _cancel(); return; } } // this is not good. RemoteFileMessages.Invoke.Failed(RemoteLocation); } catch (AggregateException e) { RemoteFileMessages.Invoke.Failed(RemoteLocation); // at this point, we've failed somehow if (_lastStatus == HttpStatusCode.NotImplemented) { // we never got started. Probably not found. } var ee = e.Flatten(); foreach (var ex in ee.InnerExceptions) { var wex = ex as WebException; if( wex != null ) { Console.WriteLine("Status:" + wex.Status); Console.WriteLine("Response:" + wex.Response); Console.WriteLine("Response:" + ((HttpWebResponse)wex.Response).StatusCode); } Console.WriteLine(ex.GetType()); Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } } catch (Exception e) { Console.WriteLine(e.GetType()); Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); } }, TaskContinuationOptions.AttachedToParent) Link To Source File
_toolkit_deprecated Installer.cs packageManager.GetPackages(SpecifiedPackage.Name + "-*-" +SpecifiedPackage.Architecture + "-"+SpecifiedPackage.PublicKeyToken , latest: true, forceScan: true, messages: _messages).ContinueWith((antecedent) => { if (antecedent.IsFaulted || antecedent.Result.IsNullOrEmpty()) { UpgradedPackage = null; // DOERROR OnReady(); return; } packageManager.GetPackageDetails(antecedent.Result.FirstOrDefault().CanonicalName, _messages).ContinueWith((antecedent2) => { if (antecedent.IsFaulted || antecedent.Result.IsNullOrEmpty()) { OnReady(); // DOERROR return; } try { UpgradedPackage = antecedent.Result.FirstOrDefault(); ExtractTrickyPackageInfo(); } catch { } OnPropertyChanged(); OnReady(); }, TaskContinuationOptions.AttachedToParent); }, TaskContinuationOptions.AttachedToParent) Link To Source File
_toolkit_deprecated Installer.cs packageManager.GetPackages(Path.GetFullPath(MsiFilename), latest: false, messages: _messages).ContinueWith((antecedent) => { if (antecedent.IsFaulted || antecedent.Result.IsNullOrEmpty() ) { // DOERROR OnReady(); return; } packageManager.GetPackageDetails(antecedent.Result.FirstOrDefault().CanonicalName, _messages).ContinueWith((antecedent2) => { if (antecedent.IsFaulted || antecedent.Result.IsNullOrEmpty()) { OnReady(); // DOERROR return; } try { SpecifiedPackage = antecedent.Result.FirstOrDefault(); ExtractTrickyPackageInfo(); } catch { } ProbeForNewerPackageInfo(); OnPropertyChanged(); OnReady(); }, TaskContinuationOptions.AttachedToParent); }, TaskContinuationOptions.AttachedToParent) Link To Source File
_toolkit_deprecated EngineService.cs serverPipe.ReadAsync(serverInput, 0, serverInput.Length).AutoManage().ContinueWith(antecedent => { var rawMessage = Encoding.UTF8.GetString(serverInput, 0, antecedent.Result); if (string.IsNullOrEmpty(rawMessage)) { return; } var requestMessage = new UrlEncodedMessage(rawMessage); // first command must be "startsession" if (!requestMessage.Command.Equals("start-session", StringComparison.CurrentCultureIgnoreCase)) { return; } // verify that user is allowed to connect. try { var hasAccess = false; serverPipe.RunAsClient(() => { hasAccess = PermissionPolicy.Connect.HasPermission; }); if (!hasAccess) return; } catch { return; } // check for the required parameters. // close the session if they are not here. if (string.IsNullOrEmpty(requestMessage["id"]) || string.IsNullOrEmpty(requestMessage.Data["client"])) { return; } var isAsync = (bool?) requestMessage["async"]; if (isAsync.HasValue && isAsync.Value == false) { StartResponsePipeAndProcessMesages(requestMessage.Data["client"], requestMessage["id"], serverPipe); } else { Session.Start(requestMessage.Data["client"], requestMessage["id"], serverPipe, serverPipe); } }) Link To Source File
_toolkit_deprecated PackageFeed.cs Recognizer.Recognize(location).ContinueWith(antecedent => { var info = antecedent.Result; PackageFeed result = null; string locationKey = null; if (info.IsPackageFeed) { if (info.IsFolder) { locationKey = Path.Combine(info.FullPath, info.Filter ); if (_allFeeds.ContainsKey(locationKey)) { return _allFeeds[locationKey]; } result = new DirectoryPackageFeed(info.FullPath, info.Filter); } else if (info.IsFile) { if (_allFeeds.ContainsKey(info.FullPath)) { return _allFeeds[info.FullPath]; } if (info.IsAtom) { result = new AtomPackageFeed(info.FullPath); } /* if (info.IsArchive) { result = new ArchivePackageFeed(info.FullPath); } * */ } // TODO: URL based feeds else if (info.IsURL) { if (_allFeeds.ContainsKey(info.FullUrl.AbsoluteUri)) { return _allFeeds[info.FullUrl.AbsoluteUri]; } if (info.IsAtom) { result = new AtomPackageFeed(info.FullUrl); } } } else if(info.IsPackageFile) { // SessionPackageFeed.Instance.Add(Package.GetPackageFromFilename(info.FullPath)); result = new DirectoryPackageFeed(Path.GetDirectoryName(info.FullPath),Path.GetFileName(info.FullPath)); // Hack of the day: // Since, I have to look up this file as a feed again later, based on the original path (likely, an http:// location) // we have to forcably set the location in the feed itself to reflect this. result.Location = location; locationKey = location; } if (result != null) { result.RecognitionInfo = info; lock (_allFeeds) { if (!_allFeeds.ContainsKey(locationKey ?? result.Location)) { _allFeeds.Add(locationKey ?? result.Location, result); } else { result = _allFeeds[locationKey ?? result.Location]; } // GS01: TODO: This is a crappy way of avoiding a deadlock when the same feed has been requested twice by two different threads. } } return result; }, TaskContinuationOptions.AttachedToParent ) Link To Source File
_toolkit_deprecated NewPackageManager.cs PackageFeed.GetPackageFeedFromLocation(feedLocation).ContinueWith(antecedent => { if (antecedent.Result != null) { Cache.Value[feedLocation] = antecedent.Result; } else { LogMessage("Feed {0} was unable to load.", feedLocation); } }, TaskContinuationOptions.AttachedToParent) Link To Source File
_toolkit_deprecated NewPackageManager.cs // add feed to the session feeds. PackageFeed.GetPackageFeedFromLocation(location).ContinueWith(antecedent => { var foundFeed = antecedent.Result; if (foundFeed != null) { if (foundFeed != SessionPackageFeed.Instance || foundFeed != InstalledPackageFeed.Instance ) { SessionCache.Value[location] = foundFeed; } } else { PackageManagerMessages.Invoke.Error("add-feed", "location", "failed to recognize location '{0}' as a valid package feed".format(location)); LogMessage("Feed {0} was unable to load.", location); } }, TaskContinuationOptions.AttachedToParent) Link To Source File
_toolkit_deprecated NewPackageManager.cs // add feed to the system feeds. PackageFeed.GetPackageFeedFromLocation(location).ContinueWith(antecedent => { var foundFeed = antecedent.Result; if (foundFeed != null) { if (foundFeed != SessionPackageFeed.Instance || foundFeed != InstalledPackageFeed.Instance) { Cache.Value[location] = foundFeed; } } else { PackageManagerMessages.Invoke.Error("add-feed", "location", "failed to recognize location '{0}' as a valid package feed".format(location)); LogMessage("Feed {0} was unable to load.", location); } }, TaskContinuationOptions.AttachedToParent) Link To Source File
_toolkit_deprecated NewPackageManager.cs // otherwise, we'll call the recognizer Recognizer.Recognize(location).ContinueWith(antecedent => { if (antecedent.IsFaulted) { PackageManagerMessages.Invoke.FileNotRecognized(location, "Unexpected error recognizing file."); return; } if (antecedent.Result.IsPackageFile) { var package = Package.GetPackageFromFilename(location); // mark it download 100% package.PackageSessionData.DownloadProgress = 100; SessionPackageFeed.Instance.Add(package); PackageManagerMessages.Invoke.PackageInformation(package, Enumerable.Empty()); PackageManagerMessages.Invoke.Recognized(localLocation); return; } if (antecedent.Result.IsPackageFeed) { PackageManagerMessages.Invoke.FeedAdded(location); PackageManagerMessages.Invoke.Recognized(location); } // if this isn't a package file, then there is something odd going on here. // we don't accept non-package files willy-nilly. PackageManagerMessages.Invoke.FileNotRecognized(location, "File isn't a package, and doesn't appear to have been requested. "); return; }, TaskContinuationOptions.AttachedToParent) Link To Source File
_toolkit_deprecated PackageCollectionExtensions.cs PackageFeed.GetPackageFeedFromLocation(feedLocation).ContinueWith(antecedent => { if (antecedent.Result != null) { if ( (from feed in feedCollection where feed.Location.Equals(feedLocation, StringComparison.CurrentCultureIgnoreCase) select feed).Count() == 0) { feedCollection.Add(antecedent.Result); } } }, TaskContinuationOptions.AttachedToParent ) Link To Source File
_toolkit_deprecated Session.cs readTask.ContinueWith(antecedent => { if (antecedent.IsFaulted || antecedent.IsCanceled || !_serverPipe.IsConnected) { Disconnect(); return; } if (antecedent.Result >= EngineService.BufferSize) { SendUnexpectedFailure(new CoAppException("Message size exceeds maximum size allowed.")); return; } var rawMessage = Encoding.UTF8.GetString(serverInput, 0, antecedent.Result); if (string.IsNullOrEmpty(rawMessage)) { return; } var requestMessage = new UrlEncodedMessage(rawMessage); var rqid = requestMessage["rqid"].ToString(); // create a request cache. new RequestCacheMessages().Register(); var dispatchTask = Dispatch(requestMessage); if (!string.IsNullOrEmpty(rqid)) { if (dispatchTask == null) { // completed synchronously. WriteAsync(new UrlEncodedMessage("task-complete") {{ "rqid", rqid } }); } else { dispatchTask.ContinueWith(dispatchAntecedent => { try { // had to force this to ensure that async writes are at least in the pipe // before waiting on the pipe drain. // without this, it is possible that the async writes are still 'getting to the pipe' // and not actually in the pipe, **even though the async write is complete** Thread.Sleep(50); if (_responsePipe != null) { _responsePipe.WaitForPipeDrain(); WriteAsync(new UrlEncodedMessage("task-complete") { { "rqid", rqid } }); } } catch (Exception e) { Logger.Error(e); // supress any exceptions. } }); } } WriteErrorsOnException(dispatchTask); // readTask = null; }) Link To Source File
Orders InvocationExtentions.cs parent.ContinueWith(task => action(task.Result)) Link To Source File
dotnetUtils HttpClient.cs task.ContinueWith(t => { token.ThrowIfCancellationRequested(); using (var streamReader = new StreamReader(t.Result)) { return streamReader.ReadToEnd(); } }) Link To Source File
dotnetUtils HttpClient.cs request.GetRequestStreamAsync() .ContinueWith(t => { body.CopyTo(t.Result); reportAndCheckToken(0.3); }) Link To Source File
fubumvc FubuOwinHost.cs task.ContinueWith(x => { try { x.FinishProcessingTask(exceptionHandlingObserver); } catch (Exception ex) { write500(response, ex); } finally { response.Finish(); } }) Link To Source File
OpenSolar QueryResultWindow.xaml.cs this.Model.RequestNewPage(this.Category).ContinueWith(_ => { if (_.Result) canRequestNewPage = this.Category.Statuses.Count > count; RequestUpdateCount.RaiseEvent(this, EventArgs.Empty); }) Link To Source File
OpenSolar MainWindow.xaml.cs task.ContinueWith(rt => RequestPostCompleted.DispatchEvent(this, new EventArgs(rt.Result))) Link To Source File
OpenSolar MainWindow.xaml.cs task.ContinueWith(rt => RequestPostCompleted.DispatchEvent(this, new EventArgs(rt.Result))) Link To Source File
OpenSolar MainWindow.xaml.cs task.ContinueWith(rt => RequestPostCompleted.DispatchEvent(this, new EventArgs(rt.Result))) Link To Source File
AwsSesWrapper.Net CommandProcessor.cs Task.Factory.FromAsync(request.BeginGetRequestStream, request.EndGetRequestStream, null) .ContinueWith(task => { if (task.Exception != null) { // usually DNS issue or server unresponsive //exception = task.Exception; throw task.Exception; //return; } // write data to request stream Stream outStream = task.Result; byte[] data = dataGetter(); if (data == null || data.Length == 0) { return; } Task writterTask = Task.Factory.FromAsync(outStream.BeginWrite, outStream.EndWrite, data, 0, data.Length, outStream, TaskCreationOptions.AttachedToParent) .ContinueWith( x => ((Stream) x.AsyncState).Close()); writterTask.Wait(); }) Link To Source File
AwsSesWrapper.Net CommandProcessor.cs Task.Factory.FromAsync(request.BeginGetResponse, request.EndGetResponse, null, TaskCreationOptions.AttachedToParent) .ContinueWith(task => { //HttpWebResponse response = null; if (task.Exception != null) { //exception = task.Exception; if (task.Exception.InnerException is WebException) { var webException = (WebException)task.Exception.InnerException; var response = webException.Response as HttpWebResponse; if (response != null && response.StatusCode != HttpStatusCode.OK) { //responseData = GetData(response); var error = new ErrorResponseParser().Process(response.GetResponseStream()); throw new AwsSesException(error, task.Exception.InnerException); } } throw task.Exception; } responseData = GetData(task.Result); } ) Link To Source File
AwsSesWrapper.Net CommandProcessor.cs Task.Factory.FromAsync(inStream.BeginRead, inStream.EndRead, buffer, 0, buffer.Length, null, TaskCreationOptions.AttachedToParent) .ContinueWith(task => { bytesRead = task.Result; if (bytesRead > 0) { output.Write(buffer, 0, bytesRead); } }) Link To Source File
Tempest NetworkConnection.cs tcs.Task.ContinueWith (t => (TResponse)t.Result) Link To Source File
Tempest MockConnectionProvider.cs otcs.Task.ContinueWith (t => tcs.SetResult ((TResponse)t.Result)) Link To Source File
Filechronization TaskCenter.cs _manager.ConnectTask(_netModule.PeerCenter, arbiter) .ContinueWith(prev => { var task = new AuthorizationClientTask(_netModule, _netModule.CurrentUser); SharedContext.taskManager.AddTask(peer.EndPointAddress, task); task.Start(); }) Link To Source File
xbuilder ContentPreviewToolWindowControl.xaml.cs loadTask.ContinueWith(t => { string buildError = t.Result; if (!string.IsNullOrEmpty(buildError)) { // If the build failed, display an error message. txtInfo.Text = "Uh-oh. Something went wrong. Check the Output window for details."; XBuilderWindowPane.WriteLine(buildError); } else { windowsFormsHost.Visibility = Visibility.Visible; txtInfo.Visibility = Visibility.Hidden; } }, ui) Link To Source File
GiveCRM GeneratorWindow.xaml.cs Task.Factory.StartNew(() => Log("Refreshing database statistics..."), CancellationToken.None, TaskCreationOptions.None, uiContext) .ContinueWith(t => new DatabaseStatisticsLoader().Load(db), TaskContinuationOptions.LongRunning) .ContinueWith(t => { DatabaseStatistics dbStats = t.Result; Log("Database statistics refreshed successfully"); NumberOfMembersLabel.Content = dbStats.NumberOfMembers.ToString(); NumberOfCampaignsLabel.Content = dbStats.NumberOfCampaigns.ToString(); NumberOfSearchFiltersLabel.Content = dbStats.NumberOfSearchFilters.ToString(); NumberOfDonationsLabel.Content = dbStats.NumberOfDonations.ToString(); }, uiContext) Link To Source File
nuget ConsoleDispatcher.cs Task.Factory.StartNew( // gives the host a chance to do initialization works before the console starts accepting user inputs () => host.Initialize(WpfConsole) ).ContinueWith( task => { if (task.IsFaulted) { var exception = task.Exception; WriteError((exception.InnerException ?? exception).Message); } if (host.IsCommandEnabled) { Microsoft.VisualStudio.Shell.ThreadHelper.Generic.Invoke(_dispatcher.Start); } if (StartCompleted != null) { Microsoft.VisualStudio.Shell.ThreadHelper.Generic.Invoke(() => StartCompleted(this, EventArgs.Empty)); } IsStartCompleted = true; }, TaskContinuationOptions.NotOnCanceled ) Link To Source File
nuget PackageChooserViewModel.cs Task.Factory.StartNew(GetPackageRepository).ContinueWith( task => { DataServicePackageRepository repository = task.Result; if (repository == null) { StatusContent = String.Empty; ClearPackages(); return; } var query = repository.GetPackages(); if (!String.IsNullOrEmpty(_currentSearch)) { query = query.Find(_currentSearch.Split(' ')); } switch (SortColumn) { case "Id": query = SortDirection == ListSortDirection.Descending ? query.OrderByDescending(p => p.Id) : query.OrderBy(p => p.Id); break; case "Authors": query = SortDirection == ListSortDirection.Descending ? query.OrderByDescending(p => p.Authors) : query.OrderBy(p => p.Authors); break; case "VersionDownloadCount": query = SortDirection == ListSortDirection.Descending ? query.OrderByDescending(p => p.VersionDownloadCount) : query.OrderBy(p => p.VersionDownloadCount); break; case "Rating": query = SortDirection == ListSortDirection.Descending ? query.OrderByDescending(p => p.VersionRating) : query.OrderBy(p => p.VersionRating); break; default: query = query.OrderByDescending(p => p.VersionDownloadCount); break; } _currentQuery = query.Select(p => new PackageInfo { Id = p.Id, Version = p.Version, Authors = p.Authors, VersionRating = p.VersionRating, VersionDownloadCount = p.VersionDownloadCount, PackageHash = p.PackageHash }); // every time the search query changes, we reset to page 0 LoadPage(0); }, CancellationToken.None, TaskContinuationOptions.OnlyOnRanToCompletion, uiScheduler ) Link To Source File
corlib WaitHandleExtensions.cs tcs.Task.ContinueWith (_ => unregister ()) Link To Source File
corlib WaitHandleExtensions.cs tcs.Task.ContinueWith (_ => asyncCallback (asyncResult)) Link To Source File
ILSpy AboutPage.cs GetLatestVersionAsync().ContinueWith( delegate (Task task) { try { stackPanel.Children.Clear(); ShowAvailableVersion(task.Result, stackPanel); } catch (Exception ex) { AvalonEditTextOutput exceptionOutput = new AvalonEditTextOutput(); exceptionOutput.WriteLine(ex.ToString()); textView.ShowText(exceptionOutput); } }, TaskScheduler.FromCurrentSynchronizationContext()) Link To Source File
ILSpy AboutPage.cs GetLatestVersionAsync().ContinueWith( delegate (Task task) { try { s.LastSuccessfulUpdateCheck = DateTime.UtcNow; AvailableVersionInfo v = task.Result; if (v.Version > currentVersion) tcs.SetResult(v.DownloadUrl); else tcs.SetResult(null); } catch (AggregateException) { // ignore errors getting the version info tcs.SetResult(null); } }) Link To Source File
ILSpy DisplaySettingsPanel.xaml.cs task.ContinueWith( delegate(Task continuation) { App.Current.Dispatcher.Invoke( DispatcherPriority.Normal, (Action)( () => { fontSelector.ItemsSource = task.Result; if (continuation.Exception != null) { foreach (var ex in continuation.Exception.InnerExceptions) { MessageBox.Show(ex.ToString()); } } }) ); } ) Link To Source File
ILSpy MainWindow.xaml.cs AboutPage.CheckForUpdatesIfEnabledAsync(spySettings).ContinueWith( delegate (Task task) { if (task.Result != null) { updateAvailableDownloadUrl = task.Result; updateAvailablePanel.Visibility = Visibility.Visible; } }, TaskScheduler.FromCurrentSynchronizationContext() ) Link To Source File
ILSpy DecompilerTextView.cs task.ContinueWith(delegate { Dispatcher.BeginInvoke(DispatcherPriority.Normal, continuation); }) Link To Source File
SharpDevelop ParserService.cs BeginParse(fileName, snapshot).ContinueWith( delegate(Task backgroundTask) { ParseInformation parseInfo = backgroundTask.Result; RaiseParserUpdateStepFinished(new ParserUpdateStepEventArgs(fileName, snapshot, parseInfo)); }) Link To Source File
BinaryAnalysis.Core SchedulerInstance.cs taskFactory.StartNew((s) => { var ss = s as PersistentSchedulerTask; ss.ScriptFinished += OnScriptFinished; ss.ScriptStarted += OnScriptStarted; ss.ScriptCustomEvent += OnScriptCustomEvent; ss.TaskFinished += OnTaskFinished; ss.TaskStarted += OnTaskStarted; log.Debug("Starting: " + ss); ss.Execute(container); return ss; },schedule) .ContinueWith((s) => { try { var ss = s.Result as PersistentSchedulerTask; ss.ScriptFinished -= OnScriptFinished; ss.ScriptStarted -= OnScriptStarted; ss.TaskFinished -= OnTaskFinished; ss.ScriptCustomEvent -= OnScriptCustomEvent; ss.TaskStarted -= OnTaskStarted; runningTasks.Remove(ss); log.Debug("Finished: " + ss); CheckQueue(this); } catch (Exception ex) { log.Error("Unhandler error in schedule task", ex); } }) Link To Source File
Pentacorn LinqToTasks.cs source.ContinueWith(t => { var result = t.Result; var key = keySelector(result); var element = elementSelector(result); return (IGrouping)new OneElementGrouping { Key = key, Element = element }; }, TaskContinuationOptions.NotOnCanceled) Link To Source File
LessonsLearned SearchPersonDetailsActivity.cs Task.Factory.StartNew(() => _personSearchService.SearchPersonDetails(input)).ContinueWith( ant => RaiseFinished(ant.Result)) Link To Source File
LessonsLearned SearchPersonActivity.cs Task.Factory.StartNew(() => _personSearchService.SearchPerson(input)).ContinueWith( ant => RaiseFinished(ant.Result)) Link To Source File
ViajesDosan.CityTours.Invoices SearchViewModel.cs Task.Factory. StartNew(() => _resellersService.SearchByName(resellerName).FirstOrDefault()). ContinueWith(r => Reseller = ResellerViewModel.From(r.Result)) Link To Source File
DotNetNuke.Extensions DynamicModel.cs task.ContinueWith(x => callback.Invoke(x.Result.ToExpandoList())) Link To Source File
Mystique InputBlockViewModel.cs w.DoWork().ContinueWith(t => { if (t.Result) { Thread.Sleep(Setting.Instance.ExperienceProperty.PostFinishShowLength); DispatcherHelper.BeginInvoke(() => this._updateWorkers.Remove(w)); } }) Link To Source File
Mystique UpdateWorker.cs this.DoWork().ContinueWith(t => { if (t.Result) { Thread.Sleep(Setting.Instance.ExperienceProperty.PostFinishShowLength); DispatcherHelper.BeginInvoke(() => parent.UpdateWorkers.Remove(this)); } }) Link To Source File
AwesomiumSharp TabView.cs // We do not need to perform the download of the favicon synchronously. // May be a full icon set (thus big). Task.Factory.StartNew( GetFavicon, val.ToString() ).ContinueWith( ( t ) => { // If the download completed successfully, set the new favicon. // This post-completion procedure is executed synchronously. if ( t.Exception == null ) this.SetValue( TabView.FaviconPropertyKey, t.Result ); }, TaskScheduler.FromCurrentSynchronizationContext() ) Link To Source File
tdameritrade TDAClient.cs GetXmlAsync(url, data) .ContinueWith(task => { var xml = task.Result.Root; if (xml.Element("result").Value == "OK") { var user = xml.Element("xml-log-in"); this.sessionID = user.Element("session-id").Value; this.timeout = user.Element("timeout").ToTimeSpan(); this.User = new User { IsAuthenticated = true, UserName = user.Element("user-id").Value, LastLoginDate = user.Element("login-time").ToDate(), Status = user.Element("exchange-status").ToExchangeStatus(), }; this.User.Realtime.NYSE = user.Element("nyse-quotes").IsRealtime(); this.User.Realtime.NASDAQ = user.Element("nasdaq-quotes").IsRealtime(); this.User.Realtime.OPRA = user.Element("opra-quotes").IsRealtime(); this.User.Realtime.AMEX = user.Element("amex-quotes").IsRealtime(); this.User.Authorizations.Options360 = user.Element("authorizations").Element("options360").ToBoolean(); this.User.Accounts = new ReadOnlyCollection( user.Element("accounts").Elements("account").Select(x => { var pref = x.Element("preferences"); var auth = x.Element("authorizations"); var account = new Account { ID = x.Element("account-id").Value, DisplayName = x.Element("display-name").Value, Description = x.Element("description").Value, IsAssociatedAccount = x.Element("associated-account").ToBoolean(), Company = x.Element("company").Value, Segment = x.Element("segment").Value, IsUnified = x.Element("unified").ToBoolean(), Preferences = new AccountPreferences { IsExpressTrading = pref.Element("express-trading").ToBoolean(), IsOptionDirectRouting = pref.Element("option-direct-routing").ToBoolean(), IsStockDirectRouting = pref.Element("stock-direct-routing").ToBoolean(), }, Authorizations = new AccountAuthorizations { Apex = auth.Element("apex").ToBoolean(), Level2 = auth.Element("level2").ToBoolean(), StockTrading = auth.Element("stock-trading").ToBoolean(), MarginTrading = auth.Element("margin-trading").ToBoolean(), StreamingNews = auth.Element("streaming-news").ToBoolean(), OptionTrading = auth.Element("option-trading").ToOptionTradingType(), Streamer = auth.Element("streamer").ToBoolean(), AdvancedMargin = auth.Element("advanced-margin").ToBoolean(), } }; return account; } ).ToList() ); this.User.Account = this.User.Accounts.FirstOrDefault(x => x.ID == user.Element("associated-account-id").Value); return new Response(true); } this.User = new User(); return new Response(false, new ResponseError(xml.Element("error").Value)); }) Link To Source File
tdameritrade TDAClient.cs GetXmlAsync(url) .ContinueWith(task => { var xml = task.Result.Root; if (xml.Element("result").Value == "LoggedOut") { this.User = new User(); return new Response(); } return new Response(new ResponseError(xml.Element("error").Value)); }) Link To Source File
Logos.Utility TaskUtility.cs // set the result (or failure) when the value is known task.ContinueWith(t => { result.SetFromTask(t); if (callback != null) callback(result.Task); }) Link To Source File
lokad-cloud CloudEnvironment.cs GetWorkerInstanceCount(CancellationToken.None).ContinueWith(task => { if (task.Result < minNumberOfInstances) { SetWorkerInstanceCount(minNumberOfInstances, CancellationToken.None); } }) Link To Source File
lokad-cloud-provisioning HttpClientExtensions.cs httpClient.SendAsync(request(), cancellationToken).ContinueWith(task => { try { bool isCancellationRequested = cancellationToken.IsCancellationRequested; if (task.IsFaulted) { var baseException = task.Exception.GetBaseException(); // If cancelled: HttpExceptions are assumed to be caused by the cancellation, hence we ignore them and cancel. if (isCancellationRequested && baseException is HttpException) { completionSource.TrySetCanceled(); return; } // Fail task if we don't retry TimeSpan retryDelay; if (shouldRetry == null || !shouldRetry(retryCount, baseException, out retryDelay)) { completionSource.TrySetException(baseException); return; } // If cancelled: We would normally retry, but it was cancelled, hence we ignore the fault and cancel. if (isCancellationRequested) { completionSource.TrySetCanceled(); return; } // Retry immediately if (retryDelay <= TimeSpan.Zero) { SendXmlAsync(httpClient, request, completionSource, cancellationToken, shouldRetry, retryCount + 1, handle); return; } // Retry later new Timer(self => { // Consider to use TaskEx.Delay instead once available ((IDisposable)self).Dispose(); // Do not retry if cancelled in the meantime if (cancellationToken.IsCancellationRequested) { completionSource.TrySetCanceled(); return; } SendXmlAsync(httpClient, request, completionSource, cancellationToken, shouldRetry, retryCount + 1, handle); }).Change(retryDelay, TimeSpan.FromMilliseconds(-1)); return; } if (task.IsCanceled || isCancellationRequested) { completionSource.TrySetCanceled(); return; } handle(task.Result); } catch (Exception e) { // we do not retry if the exception happened in the continuation completionSource.TrySetException(e); } }, TaskContinuationOptions.ExecuteSynchronously) Link To Source File
lokad-cloud-provisioning AzureCurrentDeployment.cs // NOTE: _currentDeployment may not be available yet in other continuations. This is ok. completionSource.Task.ContinueWith(t => { lock (_currentDeploymentDiscoveryLock) { _currentDeployment = t.Result; } }, TaskContinuationOptions.OnlyOnRanToCompletion) Link To Source File
Channel9Downloader DownloadManager.cs task.ContinueWith( x => { _numberOfRunningDownloads--; if (_numberOfRunningDownloads == 0) { RaiseDownloadingStopped(new EventArgs()); } if (x.IsCanceled) { _downloadQueue.AddFirst(item); } else { _finishedDownloadsRepository.AddFinishedDownload(item.RssItem); StartDownloads(); } _cancellationTokenSources.Remove(item); }) Link To Source File
DistAppLog Massive.cs task.ContinueWith(x => callback.Invoke(x.Result.ToExpandoList())) Link To Source File
nuget ConsoleDispatcher.cs Task.Factory.StartNew( // gives the host a chance to do initialization works before the console starts accepting user inputs () => host.Initialize(WpfConsole) ).ContinueWith( task => { if (task.IsFaulted) { var exception = ExceptionUtility.Unwrap(task.Exception); WriteError(exception.Message); } if (host.IsCommandEnabled) { Microsoft.VisualStudio.Shell.ThreadHelper.Generic.Invoke(_dispatcher.Start); } RaiseEventSafe(StartCompleted); IsStartCompleted = true; }, TaskContinuationOptions.NotOnCanceled ) Link To Source File
SwarmIntelligence LinqToTasks.cs source.ContinueWith(t => { var result = t.Result; var key = keySelector(result); var element = elementSelector(result); return (IGrouping)new OneElementGrouping { Key = key, Element = element }; }, TaskContinuationOptions.NotOnCanceled) Link To Source File
EasyNetQ RabbitBus.cs responseTask.ContinueWith(task => { if (task.IsFaulted) { if (task.Exception != null) { tcs.SetException(task.Exception); } } else { // wait for the connection to come back while (!connection.IsConnected) Thread.Sleep(100); using(var responseChannel = connection.CreateModel()) { var responseProperties = responseChannel.CreateBasicProperties(); responseProperties.Type = serializeType(typeof (TResponse)); var responseBody = serializer.MessageToBytes(task.Result); responseChannel.BasicPublish( "", // exchange properties.ReplyTo, // routingKey responseProperties, // basicProperties responseBody); // body } tcs.SetResult(null); } }) Link To Source File
EasyNetQ TaskCompletionSourceSpike.cs task.ContinueWith(t => Console.WriteLine(t.Result)) Link To Source File
EasyNetQ TaskCompletionSourceSpike.cs task.ContinueWith(t => Console.WriteLine(t.Result)) Link To Source File
monodevelop OnlineTemplateService.cs t.ContinueWith ((Task twr) => { try { var response = (HttpWebResponse) twr.Result; if (response.StatusCode == HttpStatusCode.OK) { if (!Directory.Exists (file.ParentDirectory)) Directory.CreateDirectory (file.ParentDirectory); using (var fs = File.Create (file)) response.GetResponseStream ().CopyTo (fs); LoggingService.LogInfo ("Updated online template index '{0}'.", url); } } catch (WebException wex) { var httpResp = wex.Response as HttpWebResponse; if (httpResp != null && httpResp.StatusCode == HttpStatusCode.NotModified) { File.SetLastWriteTime (file, DateTime.Now); LoggingService.LogInfo ("Online template index is up-to-date."); } else { string message = string.Format ("Online template index '{0}' could not be downloaded.", url); LoggingService.LogWarning (message, wex); throw; } } catch (Exception ex) { string message = string.Format ("Online template index '{0}' could not be downloaded.", url); LoggingService.LogWarning (message, ex); throw; } }) Link To Source File
NugetCracker ConsoleDispatcher.cs Task.Factory.StartNew( // gives the host a chance to do initialization works before the console starts accepting user inputs () => host.Initialize(WpfConsole) ).ContinueWith( task => { if (task.IsFaulted) { var exception = ExceptionUtility.Unwrap(task.Exception); WriteError(exception.Message); } if (host.IsCommandEnabled) { Microsoft.VisualStudio.Shell.ThreadHelper.Generic.Invoke(_dispatcher.Start); } RaiseEventSafe(StartCompleted); IsStartCompleted = true; }, TaskContinuationOptions.NotOnCanceled ) Link To Source File
dotnet Program.cs Task.Factory.StartNew(s => { Console.WriteLine( String.Format("[{0}] {1} started, will take {2} miliseconds to complete . . .", DateTime.Now.TimeOfDay, temp.Value, interval ) ); Thread.Sleep(interval); return "Lorem ipsum dolor sit amet."; /// /// Creates a continuation action so each tasks will print /// its name and return value immediately after completion. /// }, temp.Value).ContinueWith(t => Console.WriteLine( String.Format( "[{0}] {1} completed. Result: {2}", DateTime.Now.TimeOfDay, t.AsyncState, t.Result) ) ) Link To Source File
Fuzz ProcessingWindow.cs Task.Factory.StartNew(() => this.system.ProcessImage(resizedSource, observerData, processingMethod)) .ContinueWith(x => OnProcessingExecutionCompleted(x.Result), TaskScheduler.FromCurrentSynchronizationContext()) Link To Source File
WCFWeb HttpMessageHandlerChannel.cs this.channel.pipeline.SendAsync(request, this.contextCancellationTokenSource.Token).ContinueWith( task => { HttpResponseMessage httpResponse = null; if (task.IsFaulted) { // We must inspect task.Exception -- otherwise it is automatically rethrown. AggregateException flattenedException = task.Exception.Flatten(); Fx.Exception.AsError(flattenedException); httpResponse = StandardHttpResponseMessageBuilder.CreateInternalServerErrorResponse(request, flattenedException, this.channel.IncludeExceptionDetailInFaults, null); } else if (task.IsCanceled) { httpResponse = StandardHttpResponseMessageBuilder.CreateInternalServerErrorResponse(request, new OperationCanceledException(), this.channel.IncludeExceptionDetailInFaults, null); } else { httpResponse = task.Result; } if (!this.receiveResult.IsCompleted) { // If the request didn't make it to the service then we handle the response directly and start another request. this.receiveResult.StartReceive(); // Send short cirquited response this.SendShortCircuitHttpResponse(httpResponse); } else if (this.channel.AsynchronousSendEnabled) { // Otherwise follow the normal reply route through RequestContext this.replyResult.ContinueReplyPath(httpResponse); } return httpResponse; }, this.contextCancellationTokenSource.Token) Link To Source File
MXML2MuseScore MainWindowViewModel.cs task.ContinueWith(resultTask => { CurrentDocument = resultTask.Result; IsBusy = false; }) Link To Source File
coapp CoTaskFactory.cs tcs.Task.ContinueWith(antecedent => { endMethod(antecedent.Result); }) Link To Source File
coapp CoTaskFactory.cs tcs.Task.ContinueWith(antecedent => { endMethod(antecedent.Result); }) Link To Source File
coapp CoTaskFactory.cs tcs.Task.ContinueWith(antecedent => { endMethod(antecedent.Result); }) Link To Source File
coapp CoTaskFactory.cs tcs.Task.ContinueWith(antecedent => { endMethod(antecedent.Result); }) Link To Source File
coapp CoTaskFactory.cs tcs.Task.ContinueWith(antecedent => { endMethod(antecedent.Result); }) Link To Source File
nji NjiApi.cs GetPackageMetadataAsync(package) .ContinueWith(metadataTask => { if (metadataTask.IsFaulted) throw metadataTask.Exception.GetBaseException(); dynamic metadata = metadataTask.Result; // don't download if package is already the latest version. string packageJson = Path.Combine(WorkingDirectory, "node_modules", package.Split(new [] { '@' }, 2)[0], // drop everything after the @ sign, since modules get installed to directories without a version string "package.json"); if (File.Exists(Path.Combine(packageJson))) { dynamic localMetadata = SimpleJson.DeserializeObject(File.ReadAllText(packageJson)); if (localMetadata.ContainsKey("name") && localMetadata.ContainsKey("version")) { if (metadata.name == localMetadata.name && metadata.version == localMetadata.version) { if (Verbose > 0) Out.WriteLine("Skipping {0}. Already on latest version", package); return metadataTask; // should it check dependencies too? // return InstallDependencies((object)metadata, cancellationToken, installDependencies); } } } string tarballUrl = metadata.dist.tarball; // recursively reuse InstallAsync :) InstallAsync accepts url return InstallAsync(tarballUrl, cancellationToken, installDependencies); }) Link To Source File
nji NjiApi.cs GetPackageMetadataAsync(packageName, cancellationToken) .ContinueWith(t2 => { if (t2.IsFaulted) throw t2.Exception; return InstallAsync(packageName, cancellationToken); }) Link To Source File
preprompt-parallel TaskExtensions.cs // // The task argument will also be a completion source, racing with // the timer to set the final state of the proxy task. // task.ContinueWith(t => { timer.Dispose(); tcs.SetFromTask(t); }) Link To Source File
ravendb ReplicationTask.cs Task.Factory.StartNew(() => ReplicateTo(destination), TaskCreationOptions.LongRunning) .ContinueWith(completedTask => { if (completedTask.Exception != null) { log.ErrorException("Could not replicate to " + destination, completedTask.Exception); return; } if (completedTask.Result) // force re-evaluation of replication again docDb.WorkContext.NotifyAboutWork(); }) Link To Source File
ravendb AsyncDatabaseCommandsExtensions.cs cmds.GetTermsAsync(indexName, field, fromValue, pageSize) .ContinueWith(task => { terms = task.Result; var termRequests = terms.Select(term => new IndexQuery { Query = field + ":" + RavenQuery.Escape(term), PageSize = 0, }.GetIndexQueryUrl("", indexName, "indexes")) .Select(url => { var uriParts = url.Split(new[] {'?'}, StringSplitOptions.RemoveEmptyEntries); return new GetRequest { Url = uriParts[0], Query = uriParts[1] }; }) .ToArray(); if (termRequests.Length == 0) return Task.Factory.StartNew(() => new NameAndCount[0]); return cmds.MultiGetAsync(termRequests) .ContinueWith(termsResultsTask => termsResultsTask.Result.Select((t, i) => new NameAndCount { Count = RavenJObject.Parse(t.Result).Value("TotalResults"), Name = terms[i] }).ToArray()); }) Link To Source File
ravendb AsyncDatabaseCommandsExtensions.cs cmds.MultiGetAsync(termRequests) .ContinueWith(termsResultsTask => termsResultsTask.Result.Select((t, i) => new NameAndCount { Count = RavenJObject.Parse(t.Result).Value("TotalResults"), Name = terms[i] }).ToArray()) Link To Source File
ravendb AsyncServerClient.cs webRequest.GetResponseAsync() .ContinueWith(task => { try { task.Result.Close(); if (overwrite == false) throw new InvalidOperationException("Cannot put index: " + name + ", index already exists"); } catch (WebException e) { var response = e.Response as HttpWebResponse; if (response == null || response.StatusCode != HttpStatusCode.NotFound) throw; } var request = jsonRequestFactory.CreateHttpJsonRequest(this, requestUri, "PUT", credentials, convention); request.AddOperationHeaders(OperationsHeaders); var serializeObject = JsonConvert.SerializeObject(indexDef, Default.Converters); return Task.Factory.FromAsync(request.BeginWrite, request.EndWrite,serializeObject, null) .ContinueWith(writeTask => request.ReadResponseJsonAsync() .ContinueWith(readJsonTask => { return readJsonTask.Result.Value("index"); })).Unwrap(); }) Link To Source File
ravendb AsyncServerClient.cs request.ReadResponseJsonAsync() .ContinueWith(task1 => { try { return convention.CreateSerializer().Deserialize(new RavenJTokenReader(task1.Result)); } catch (WebException e) { var httpWebResponse = e.Response as HttpWebResponse; if (httpWebResponse == null || httpWebResponse.StatusCode != HttpStatusCode.Conflict) throw; throw ThrowConcurrencyException(e); } }) Link To Source File
ravendb AsyncServerClient.cs request.ReadResponseJsonAsync() .ContinueWith(task => { try { var requestJson = task.Result; return SerializationHelper.DeserializeJsonDocument(key, requestJson, request.ResponseHeaders, request.ResponseStatusCode); } catch (WebException e) { var httpWebResponse = e.Response as HttpWebResponse; if (httpWebResponse == null) throw; if (httpWebResponse.StatusCode == HttpStatusCode.NotFound) return null; if (httpWebResponse.StatusCode == HttpStatusCode.Conflict) { var conflicts = new StreamReader(httpWebResponse.GetResponseStreamWithHttpDecompression()); var conflictsDoc = RavenJObject.Load(new JsonTextReader(conflicts)); var conflictIds = conflictsDoc.Value("Conflicts").Select(x => x.Value()).ToArray(); throw new ConflictException("Conflict detected on " + key + ", conflict must be resolved before the document will be accessible") { ConflictedVersionIds = conflictIds }; } throw; } }) Link To Source File
ravendb AsyncServerClient.cs jsonRequestFactory.CreateHttpJsonRequest(this, requestUri, "GET", credentials, convention) .ReadResponseJsonAsync() .ContinueWith(task => ((RavenJArray)task.Result) .Cast() .ToJsonDocuments() .ToArray()) Link To Source File
ravendb AsyncServerClient.cs request.ReadResponseJsonAsync() .ContinueWith(task => { var json = (RavenJObject) task.Result; return json.JsonDeserialization>>(); }) Link To Source File
ravendb AsyncServerClient.cs httpJsonRequest.ReadResponseJsonAsync() .ContinueWith(replyTask => { var responses = convention.CreateSerializer().Deserialize(new RavenJTokenReader(replyTask.Result)); return multiGetOperation.HandleCachingResponse(responses, jsonRequestFactory); }) Link To Source File
ravendb AsyncServerClient.cs request.ReadResponseJsonAsync() .ContinueWith(task => { var json = (RavenJObject) task.Result; return new QueryResult { IsStale = Convert.ToBoolean(json["IsStale"].ToString()), IndexTimestamp = json.Value("IndexTimestamp"), IndexEtag = new Guid(request.ResponseHeaders["ETag"]), Results = ((RavenJArray)json["Results"]).Cast().ToList(), TotalResults = Convert.ToInt32(json["TotalResults"].ToString()), IndexName = json.Value("IndexName"), SkippedResults = Convert.ToInt32(json["SkippedResults"].ToString()) }; }) Link To Source File
ravendb AsyncServerClient.cs request.ReadResponseJsonAsync() .ContinueWith(task => { var json = (RavenJObject) task.Result; return new SuggestionQueryResult { Suggestions = ((RavenJArray) json["Suggestions"]).Select(x => x.Value()).ToArray(), }; }) Link To Source File
ravendb AsyncServerClient.cs url.Databases() .NoCache() .ToJsonRequest(this, credentials, convention) .ReadResponseJsonAsync() .ContinueWith(task => { var json = (RavenJArray)task.Result; return json .Select(x => x.Value("@metadata").Value("@id").Replace("Raven/Databases/", string.Empty)) .ToArray(); }) Link To Source File
ravendb HttpJsonRequest.cs ReadResponseStringAsync() .ContinueWith(x => { var result = x.Result; return RavenJToken.Parse(result); }) Link To Source File
ravendb HttpJsonRequest.cs unauthorizedResponseAsync.ContinueWith(task => RecreateWebRequest(unauthorizedResponseAsync.Result)) Link To Source File
ravendb AsyncDocumentSession.cs AsyncDatabaseCommands.BatchAsync(data.Commands.ToArray()) .ContinueWith(task => { UpdateBatchResults(task.Result, data); cachingScope.Dispose(); }) Link To Source File
ravendb AsyncMultiLoaderWithInclude.cs session.LoadAsyncInternal(new[] {id}, includes.ToArray()).ContinueWith(x => x.Result.FirstOrDefault()) Link To Source File
ravendb AbstractDocumentQuery.cs theAsyncDatabaseCommands.QueryAsync(indexName, queryOperation.IndexQuery, includes.ToArray()) .ContinueWith(task => { if (queryOperation.IsAcceptable(task.Result) == false) { return TaskEx.Delay(100) .ContinueWith(_ => ExecuteActualQueryAsync()) .Unwrap(); } InvokeAfterQueryExecuted(queryOperation.CurrentQueryResults); return TaskEx.Run(() => queryOperation); }) Link To Source File
ravendb AbstractDocumentQuery.cs QueryResultAsync .ContinueWith(r => r.Result.TotalResults) Link To Source File
ravendb DocumentStore.cs authRequest.GetResponseAsync() .AddUrlIfFaulting(authRequest.RequestUri) .ConvertSecurityExceptionToServerNotFound() .ContinueWith(task => { #if !SILVERLIGHT using (var stream = task.Result.GetResponseStreamWithHttpDecompression()) #else using(var stream = task.Result.GetResponseStream()) #endif using (var reader = new StreamReader(stream)) { currentOauthToken = "Bearer " + reader.ReadToEnd(); return (Action)(request => request.Headers["Authorization"] = currentOauthToken); } }) Link To Source File
ravendb MultiTenancyExtensions.cs self.GetAsync(docId) .ContinueWith(get => { if (get.Result != null) return get; return (Task)self.PutAsync(docId, null, doc, new RavenJObject()); }) Link To Source File
ravendb TaskExtensions.cs parent.ContinueWith(task => { if (task.IsFaulted) { var e = task.Exception.ExtractSingleInnerException(); if (e != null) e.Data["Url"] = uri; } return task; }) Link To Source File
ravendb LinqExtensions.cs documentQuery.ToListAsync() .ContinueWith(task => task.Result.Item1.TotalResults) Link To Source File
ravendb ParallelShardAccessStrategy.cs Task.Factory .StartNew(() => operation(shardSession)) .ContinueWith(task => { returnedLists[i] = task.Result; }) Link To Source File
ravendb AsyncServerClient.cs request .ReadResponseJsonAsync() .ContinueWith(task => { try { var token = task.Result; return new JsonDocument { DataAsJson = (RavenJObject)token, NonAuthoritativeInformation = request.ResponseStatusCode == HttpStatusCode.NonAuthoritativeInformation, Key = key, LastModified = DateTime.ParseExact(request.ResponseHeaders[Constants.LastModified].First(), "r", CultureInfo.InvariantCulture).ToLocalTime(), Etag = new Guid(request.ResponseHeaders["ETag"].First()), Metadata = request.ResponseHeaders.FilterHeaders(isServerDocument: false) }; } catch (AggregateException e) { var webException = e.ExtractSingleInnerException() as WebException; if (webException != null) { if (HandleWebExceptionForGetAsync(key, webException)) return null; } throw; } catch (WebException e) { if (HandleWebExceptionForGetAsync(key, e)) return null; throw; } }) Link To Source File
ravendb AsyncServerClient.cs request.ReadResponseJsonAsync() .ContinueWith(task => AttemptToProcessResponse(() => SerializationHelper.ToQueryResult((RavenJObject) task.Result, request.ResponseHeaders["ETag"].First()))) Link To Source File
ravendb AsyncServerClient.cs url.IndexDefinition(name) .NoCache() .ToJsonRequest(this, credentials, convention).ReadResponseJsonAsync() .ContinueWith(task => { var json = (RavenJObject)task.Result; //NOTE: To review, I'm not confidence this is the correct way to deserialize the index definition return convention.CreateSerializer().Deserialize(new RavenJTokenReader(json["Index"])); }) Link To Source File
ravendb AsyncServerClient.cs request.ReadResponseJsonAsync() .ContinueWith(task => { var json = ((RavenJArray)task.Result); //NOTE: To review, I'm not confidence this is the correct way to deserialize the index definition return json .Select(x => JsonConvert.DeserializeObject(((RavenJObject)x)["definition"].ToString(), new JsonToJsonConverter())) .ToArray(); }) Link To Source File
ravendb AsyncServerClient.cs request.ReadResponseJsonAsync() .ContinueWith(task => { var json = (RavenJObject) task.Result; return new SuggestionQueryResult { Suggestions = ((RavenJArray) json["Suggestions"]).Select(x => x.Value()).ToArray(), }; }) Link To Source File
ravendb AsyncServerClient.cs request .ReadResponseBytesAsync() .ContinueWith(task => { try { var buffer = task.Result; return new Attachment { Data = () => new MemoryStream(buffer), Etag = new Guid(request.ResponseHeaders["ETag"].First()), Metadata = request.ResponseHeaders.FilterHeaders(isServerDocument: false) }; } catch (AggregateException e) { var webException = e.ExtractSingleInnerException() as WebException; if (webException != null) { if (HandleWebExceptionForGetAsync(key, webException)) return null; } throw; } catch (WebException e) { if (HandleWebExceptionForGetAsync(key, e)) return null; throw; } }) Link To Source File
ravendb HttpJsonRequest.cs webRequest.GetRequestStreamAsync().ContinueWith(t => { var dataStream = t.Result; using (dataStream) { dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); } }) Link To Source File
ravendb DiscoveryClient.cs Task.Factory.FromAsync(udpClient.BeginSend, udpClient.EndSend, buffer, buffer.Length, allHostsGroup, null) .ContinueWith(task => { var _ = task.Exception; // basically just ignoring this error }) Link To Source File
ravendb CreateDatabaseCommand.cs AskUser.QuestionAsync("Create New Database", "Database name?") .ContinueWith(task => { if (task.IsCanceled) return; var databaseName = task.Result; if (string.IsNullOrEmpty(databaseName)) return; if (Path.GetInvalidPathChars().Any(databaseName.Contains)) throw new ArgumentException("Cannot create a database with invalid path characters: " + databaseName); ApplicationModel.Current.AddNotification(new Notification("Creating database: " + databaseName)); DatabaseCommands.EnsureDatabaseExistsAsync(databaseName) .ContinueOnSuccess(() => DatabaseCommands.ForDatabase(databaseName).EnsureSilverlightStartUpAsync()) .ContinueOnSuccessInTheUIThread(() => { var model = parameter as DatabasesListModel; if (model != null) model.ForceTimerTicked(); ApplicationModel.Current.AddNotification(new Notification("Database " + databaseName + " created")); }) .Catch(); }) Link To Source File
ravendb InvocationExtensions.cs parent.ContinueWith(task => action(task.Result)) Link To Source File
ravendb InvocationExtensions.cs parent.ContinueWith(task => { if (task.IsFaulted == false) return task; var ex = task.Exception.ExtractSingleInnerException(); Execute.OnTheUI(() => ErrorPresenter.Show(ex, stackTrace)) .ContinueWith(_ => action(task.Exception)); return task; }) Link To Source File
ravenmq SocketExtensions.cs socket.ReadBuffer(4) .ContinueWith(task => { try { var len = BitConverter.ToInt32(task.Result.Array, task.Result.Offset); if(len > TenMB) throw new InvalidOperationException("Got a reply for single JObject > 10 MB, rejecting as invalid"); socket.ReadBuffer(len) .ContinueWith(readLenTask => { try { var ms = new MemoryStream(readLenTask.Result.Array, readLenTask.Result.Offset, readLenTask.Result.Count); tcs.SetResult(ms.ToJObject()); } catch (Exception e) { tcs.SetException(e); } }); } catch (Exception e) { tcs.SetException(e); } }) Link To Source File
ravenmq SocketExtensions.cs socket.ReadBuffer(len) .ContinueWith(readLenTask => { try { var ms = new MemoryStream(readLenTask.Result.Array, readLenTask.Result.Offset, readLenTask.Result.Count); tcs.SetResult(ms.ToJObject()); } catch (Exception e) { tcs.SetException(e); } }) Link To Source File
ravenmq ServerConnection.cs Task.Factory.FromAsync(listener.BeginAccept, listener.EndAccept, null) .ContinueWith(task => { if (task.Exception != null) return; ListenForConnections(); log.DebugFormat("Got a new connection from {0}, beginning handshake", task.Result.RemoteEndPoint); Handshake(task.Result); }) Link To Source File
ravenmq RavenMQConnection.cs Task.Factory.FromAsync(webRequest.BeginGetResponse, webRequest.EndGetResponse, null) .ContinueWith(getPortResponseTask => { using (var response = getPortResponseTask.Result) using (var stream = response.GetResponseStream()) using (var reader = new StreamReader(stream)) { var result = JObject.Load(new JsonTextReader(reader)); return result.Value("SubscriptionPort"); } }) Link To Source File
ravenmq RavenMQConnection.cs Task.Factory.FromAsync(webRequest.BeginGetRequestStream, webRequest.EndGetRequestStream, null) .ContinueWith(getReqStreamTask => { getReqStreamTask.AssertNotExceptional(); var enumerable = lastEtagPerQeueue.Select(x => new ReadCommand { ReadRequest = { Queue = x.Key, LastMessageId = x.Value, } }).Select(command => JObject.FromObject(command, CreateJsonSerializer())); return getReqStreamTask.Result.Write(new JArray(enumerable)); }) Link To Source File
ravenmq RavenMQConnection.cs Task.Factory.FromAsync(webRequest.BeginGetRequestStream, webRequest.EndGetRequestStream, null) .ContinueWith(getReqStreamTask => { getReqStreamTask.AssertNotExceptional(); var enumerable = msgs.Select(msg => new EnqueueCommand { Message = msg }).Select(msg => JObject.FromObject(msg, CreateJsonSerializer())); return getReqStreamTask.Result.Write(new JArray(enumerable)); }) Link To Source File
Mobile ThreadManager.cs Task.Factory.StartNew(() => { Thread.Sleep(milliseconds); return "Slept for " + milliseconds + " milliseconds."; }).ContinueWith((task) => Enqueue(currentThread.WithResult(task.Result))) Link To Source File
Mobile ThreadManager.cs Task.Factory.StartNew(() => { try { return listener.GetContext(); } catch (Exception ex) { return ex; } }).ContinueWith((task) => Enqueue(currentThread.WithResult(task.Result))) Link To Source File
Mobile ThreadManager.cs Task.Factory.StartNew(() => { return Console.ReadLine(); }).ContinueWith((task) => Enqueue(currentThread.WithResult(task.Result))) Link To Source File
Mobile ThreadManager.cs Task.Factory.StartNew(thread).ContinueWith((task) => Enqueue(currentThread.WithResult(task.Result))) Link To Source File
NewWestlink LogProcessor.cs _reader.ReadLineAsync().ContinueWith(ProcessLine) Link To Source File
open-syno ImageCachingService.cs taskWriteToDisk.ContinueWith( taskUri => { var pathInIsolatedStorage = taskUri.Result; CachedImagesMapping cachedImagesMapping = new CachedImagesMapping { FilePath = pathInIsolatedStorage, ImageId = albumCoverId, LastTimeUsed = DateTime.Now, TimesUsed = 1 }; imageCachingService.CachedImagesMappings.Add(cachedImagesMapping); // let's try not to kill our storage by writing too often on it. Timer throttlingWriteToDisk = new Timer(t => { _tasksWritingOnDisk.Remove(taskUri); if (_tasksWritingOnDisk.Count > 0) { return; } Debug.WriteLine("Actual write request."); imageCachingService.RequestSave(EventArgs.Empty); }, null, 2000, uint.MaxValue); }, TaskScheduler.FromCurrentSynchronizationContext()) Link To Source File
open-syno TrackViewModel.cs searchArtistsTask.ContinueWith( task => { var artist = task.Result.SingleOrDefault(a => a.Title == TrackInfo.Artist); // TODO : check also that the artist name match !! otherwise, two albums might have the same name and still be two different albums. if (artist == null) { throw new NotSupportedException("we could not find strictly one perfect match for artist names. Maybe there are multiple artists with the same name in your library which might mean your library is corrupted."); } Task> searchAlbumsTask = this._session.GetAlbumsForArtistAsync(artist); searchAlbumsTask.ContinueWith(t => { var albums = t.Result; var album = albums.SingleOrDefault(o => o.Title == this.TrackInfo.Album); if (album == null) { throw new NotSupportedException("we could not find strictly one perfect match for albums names. Maybe there are multiple albums with the same name for the same artist in your library which might mean your library is corrupted."); } var albumsListTicket = Guid.NewGuid().ToString(); // TODO : move those registrations within the page switching service. // the artist whose page to show, this._urlParameterToObjectsPlateHeater.RegisterObject(artist.ItemID, artist); List albumViewModels = new List(); foreach (var item in albums) { AlbumViewModel viewModel = this._albumViewModelFactory.Create(item); albumViewModels.Add(viewModel); // populate the tracks for each album. Task> getTracksForAlbumTask = _session.GetTracksForAlbumAsync(item); getTracksForAlbumTask.ContinueWith(tracks => { var albumViewModel = albumViewModels.Single(o => o.Album == tracks.AsyncState); albumViewModel.Tracks.Clear(); foreach (var synoTrack in getTracksForAlbumTask.Result) { albumViewModel.Tracks.Add(this._trackViewModelFactory.Create(Guid.NewGuid(), synoTrack, _pageSwitchingService)); } }); } // the album shown by default. AlbumViewModel defaultAlbumViewModel = albumViewModels.Single(o => o.Album == album); this._urlParameterToObjectsPlateHeater.RegisterObject(album.ItemID, defaultAlbumViewModel); // the albums list. this._urlParameterToObjectsPlateHeater.RegisterObject(albumsListTicket, albumViewModels); this._pageSwitchingService.NavigateToArtistPanorama(artist.ItemID,album.ItemID, albumsListTicket); }, TaskScheduler.FromCurrentSynchronizationContext()); }, TaskScheduler.FromCurrentSynchronizationContext()) Link To Source File
open-syno TrackViewModel.cs searchAlbumsTask.ContinueWith(t => { var albums = t.Result; var album = albums.SingleOrDefault(o => o.Title == this.TrackInfo.Album); if (album == null) { throw new NotSupportedException("we could not find strictly one perfect match for albums names. Maybe there are multiple albums with the same name for the same artist in your library which might mean your library is corrupted."); } var albumsListTicket = Guid.NewGuid().ToString(); // TODO : move those registrations within the page switching service. // the artist whose page to show, this._urlParameterToObjectsPlateHeater.RegisterObject(artist.ItemID, artist); List albumViewModels = new List(); foreach (var item in albums) { AlbumViewModel viewModel = this._albumViewModelFactory.Create(item); albumViewModels.Add(viewModel); // populate the tracks for each album. Task> getTracksForAlbumTask = _session.GetTracksForAlbumAsync(item); getTracksForAlbumTask.ContinueWith(tracks => { var albumViewModel = albumViewModels.Single(o => o.Album == tracks.AsyncState); albumViewModel.Tracks.Clear(); foreach (var synoTrack in getTracksForAlbumTask.Result) { albumViewModel.Tracks.Add(this._trackViewModelFactory.Create(Guid.NewGuid(), synoTrack, _pageSwitchingService)); } }); } // the album shown by default. AlbumViewModel defaultAlbumViewModel = albumViewModels.Single(o => o.Album == album); this._urlParameterToObjectsPlateHeater.RegisterObject(album.ItemID, defaultAlbumViewModel); // the albums list. this._urlParameterToObjectsPlateHeater.RegisterObject(albumsListTicket, albumViewModels); this._pageSwitchingService.NavigateToArtistPanorama(artist.ItemID,album.ItemID, albumsListTicket); }, TaskScheduler.FromCurrentSynchronizationContext()) Link To Source File
open-syno TrackViewModel.cs getTracksForAlbumTask.ContinueWith(tracks => { var albumViewModel = albumViewModels.Single(o => o.Album == tracks.AsyncState); albumViewModel.Tracks.Clear(); foreach (var synoTrack in getTracksForAlbumTask.Result) { albumViewModel.Tracks.Add(this._trackViewModelFactory.Create(Guid.NewGuid(), synoTrack, _pageSwitchingService)); } }) Link To Source File
PROMPT11-07-ConcurrentProgramming.sandrapatfer TaskUtils.cs task.ContinueWith( (t) => { if (t.Status == TaskStatus.RanToCompletion) { cts.TrySetResult(t.Result); } else if (Interlocked.Decrement(ref nTasks) == 0) { cts.TrySetException(new Exception("None completed")); } }) Link To Source File
PROMPT11-07-ConcurrentProgramming.sandrapatfer TaskUtils.cs task.ContinueWith((t) => { timer.Dispose(); if (t.Status == TaskStatus.RanToCompletion) { cts.TrySetResult(t.Result); } else if (t.Status == TaskStatus.Faulted) { cts.TrySetException(t.Exception); } else //if (t.Status == TaskStatus.Canceled) { cts.TrySetCanceled(); } }) Link To Source File
PROMPT11-07-ConcurrentProgramming.sandrapatfer MoviesAsyncController_old.cs imdbTask.ContinueWith(task => ProcessIMDbResult(task, info, l)) Link To Source File
PROMPT11-07-ConcurrentProgramming.sandrapatfer MoviesAsyncController.cs CreateMainProcessRequestIterator(t, y, l).Run().ContinueWith(task => { AsyncManager.Parameters["result"] = task.Result; AsyncManager.OutstandingOperations.Decrement(); }) Link To Source File
PROMPT11-07-ConcurrentProgramming.sandrapatfer MoviesAsyncController.cs taskFlickr.ContinueWith(t => { if (t.Result.IsSuccessStatusCode) { var taskReadFlickrObj = t.Result.Content.ReadAsStreamAsync(); taskReadFlickrObj.ContinueWith(t2 => { JavaScriptSerializer jsonMaster = new JavaScriptSerializer(); var flickrInfo = jsonMaster.Deserialize(new StreamReader(t2.Result).ReadToEnd()); info.FlickrPhotos = flickrInfo.Photos.Photo.Select(p => string.Format("http://farm{0}.static.flickr.com/{1}/{2}_{3}.jpg", p.Farm, p.Server, p.Id, p.Secret)).ToList(); }); } }) Link To Source File
PROMPT11-07-ConcurrentProgramming.sandrapatfer MoviesAsyncController.cs taskReadFlickrObj.ContinueWith(t2 => { JavaScriptSerializer jsonMaster = new JavaScriptSerializer(); var flickrInfo = jsonMaster.Deserialize(new StreamReader(t2.Result).ReadToEnd()); info.FlickrPhotos = flickrInfo.Photos.Photo.Select(p => string.Format("http://farm{0}.static.flickr.com/{1}/{2}_{3}.jpg", p.Farm, p.Server, p.Id, p.Secret)).ToList(); }) Link To Source File
PROMPT11-07-ConcurrentProgramming.sandrapatfer MoviesAsyncController.cs ProcessBingIterator(imdbObj.Plot, l).Run().ContinueWith(task => { info.Description = task.Result; }) Link To Source File
PROMPT11-07-ConcurrentProgramming.sandrapatfer TaskUtils.cs task.ContinueWith((t) => { if (Interlocked.Decrement(ref nTasks) == 0) { cts.TrySetResult(t.Result); } /* else if (t.Status == TaskStatus.RanToCompletion) { cts.TrySetException(new Exception("None completed")); }*/ }) Link To Source File
SLRSyncUploader FileProcessor.cs Task.Factory.StartNew( () => ScanFileChunk(chunkCounter, cancellationToken, remoteHashes, mappedAccessor, localChunkStart, length, config), cancellationToken, TaskCreationOptions.LongRunning, TaskScheduler.Default) .ContinueWith( outHash => outHash.Result.ForEach(resultBag.Add)) Link To Source File
SLRSyncUploader FileProcessor.cs Task.Factory.StartNew( () => GetChunksForFileBlock(counter, cancellationToken, remoteHashes, fileStream, localChunkStart, length, progressReporter, config), cancellationToken, TaskCreationOptions.LongRunning, TaskScheduler.Default) .ContinueWith( outHash => { lock (lockObj) { outHash.Result.ForEach(resultBag.Add); } }) Link To Source File
SLRSyncUploader FileProcessor.cs Task.Factory.StartNew(() => CalculateHashes(taskBuffer, offSetPosition, read, config)) .ContinueWith( outHash => { resultDictionary.TryAdd(outHash.Result.WeakHash, outHash.Result); progressReporter.ReportProgressAsync( () => { if (GetHashesForFileBockComplete != null) GetHashesForFileBockComplete(taskCount, numberOfBlocks); }); }) Link To Source File
Roger Program.cs Task.Factory.StartNew(() => process.Start(waitHandle), TaskCreationOptions.LongRunning) .ContinueWith(PrintException, TaskContinuationOptions.OnlyOnFaulted) Link To Source File
SoftWrox Massive.cs task.ContinueWith(x => callback.Invoke(x.Result.ToExpandoList())) Link To Source File
WoW-Community-Platform-API MainForm.cs Task.Factory.StartNew(() => m_client.GetRealmStatus()).ContinueWith(task => FillListView(task.Result)) Link To Source File
torshify-client ImageMapFrame.xaml.cs Task.Factory .StartNew(FindAllImageFiles, imageFolder) .ContinueWith(t => CreateMapData(t.Result)) .ContinueWith(t => CreateMap(t.Result)) Link To Source File
torshify-r4dio SearchResultsViewModel.cs Task.Factory .StartNew(() => { IsLoading = true; return _radio.GetTracksByName(query, 0, 32); }) .ContinueWith(t => { _results.Clear(); foreach (var radioTrack in t.Result) { _results.Add(radioTrack); } IsLoading = false; }, ui) Link To Source File
torshify-r4dio MoodRadioStationViewModel.cs Task>.Factory .StartNew(GetAvailableMoods) .ContinueWith(t => { AvailableTerms.Clear(); foreach (var termModel in t.Result) { if (MoodRadioStation.MoodCloudData.ContainsKey(termModel.Name)) { termModel.Count = MoodRadioStation.MoodCloudData[termModel.Name]; } AvailableTerms.Add(termModel); } IsLoading = false; }, ui) Link To Source File
torshify-r4dio SimilarArtistsRadioStationViewModel.cs Task>.Factory .StartNew(() => { IsLoading = true; using (EchoNestSession session = new EchoNestSession(EchoNestConstants.ApiKey)) { SimilarArtistsArgument arg = new SimilarArtistsArgument(); arg.Name = searchPhrase; arg.Results = 20; arg.Bucket = ArtistBucket.Images | ArtistBucket.Terms; var response = session .Query() .Execute(arg); if (response.Status.Code == ResponseCode.Success) { return response.Artists; } } return new ArtistBucketItem[0]; }) .ContinueWith(t => { _similarArtists.Clear(); foreach (var name in t.Result) { _similarArtists.Add(new SimilarArtistModel { BucketItem = name, Name = name.Name, Image = name.Images != null ? name.Images.FirstOrDefault() : null, Terms = name.Terms != null ? name.Terms.Take(3) : null }); } IsLoading = false; }, TaskScheduler.FromCurrentSynchronizationContext()) Link To Source File
torshify-r4dio StyleRadioStationViewModel.cs Task>.Factory .StartNew(GetAvailableStyles) .ContinueWith(t => { AvailableTerms.Clear(); foreach (var termModel in t.Result) { if (StyleRadioStation.StyleCloudData.ContainsKey(termModel.Name)) { termModel.Count = StyleRadioStation.StyleCloudData[termModel.Name]; } AvailableTerms.Add(termModel); } IsLoading = false; }, ui) Link To Source File
torshify-server ImageService.cs GetArtistImageTask(session, artistLink.Object).ContinueWith(t => callback(t)) Link To Source File
torshify-server ImageService.cs GetImageTask(link).ContinueWith(t => callback(t)) Link To Source File
WCell LinqToTasks.cs source.ContinueWith(t => { var result = t.Result; var key = keySelector(result); var element = elementSelector(result); return (IGrouping)new OneElementGrouping { Key = key, Element = element }; }, TaskContinuationOptions.NotOnCanceled) Link To Source File
WCell TaskExtensions.cs task.ContinueWith(continuationFunction, factory.CancellationToken, factory.ContinuationOptions, factory.Scheduler) Link To Source File
WCell TaskExtensions.cs task.ContinueWith(_ => { tcs.SetFromTask(task); if (callback != null) callback(tcs.Task); }) Link To Source File
WCell TaskExtensions.cs // Create a continuation to pass data along to the observer _task.ContinueWith(t => { switch (t.Status) { case TaskStatus.RanToCompletion: observer.OnNext(_task.Result); observer.OnCompleted(); break; case TaskStatus.Faulted: observer.OnError(_task.Exception); break; case TaskStatus.Canceled: observer.OnError(new TaskCanceledException(t)); break; } }, cts.Token) Link To Source File
Robot-Sorter-Deluxe RobotController.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotController.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotController.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotController.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotController.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotController.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotController.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotController.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotController.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotSimulator.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotSimulator.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotSimulator.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotSimulator.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotSimulator.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotSimulator.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotSimulator.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotSimulator.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe RobotSimulator.cs task.ContinueWith(t => callback(t.Result)) Link To Source File
Robot-Sorter-Deluxe LogOnViewModel.cs task.ContinueWith(t => { if (t.IsFaulted || t.IsCanceled) { Messenger.Default.Send(new ExceptionMessage(t.Exception)); } else { if (t.Result != null) { Messenger.Default.Send(new UserLoggedOnMessage(t.Result)); } else { Messenger.Default.Send(new InvalidCredentialsMessage()); } } }) Link To Source File