protected virtual void Dispose(bool disposing) { if (disposing && (this.connection != null)) { this.connection.ConnectionStateChanged -= new EventHandler <ConnectionStateChangedEventArgs>(this.Connection_ConnectionStateChanged); IDisposable connection = this.connection as IDisposable; if (connection != null) { connection.Dispose(); } this.connection = null; this._sessionEstablishedAt = DateTime.MaxValue; this._symbolServer = null; } }
private static HttpClient GetHttpClient(ISymbolServer symbolServer) { var client = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false }) { BaseAddress = new Uri(symbolServer.Url) }; if (!string.IsNullOrEmpty(symbolServer.AuthorizationHeader)) { client.DefaultRequestHeaders.Add("Authorization", symbolServer.AuthorizationHeader); } return(client); }
private ValueTask <bool> DownloadPortablePdbFromSymbolServer(ISymbolServer symbolServer, string key, string downloadPath) { return(DownloadFileFromUrl(symbolServer, key, downloadPath)); }
private static ValueTask <bool> DownloadFileFromUrl(ISymbolServer symbolServer, string key, string pdbPath) { return(Download(GetHttpClient(symbolServer), symbolServer.Url + "/" + key, pdbPath)); }