private void InitSubsonicApi() { Uri serverUri = new Uri(ServerUrl); string proxyUri = string.IsNullOrWhiteSpace(ProxyServer) ? null : ProxyServer; if (!ValidateCertificate(serverUri)) { FileLogger.Log("Unable to validate server certificate, this issue must be corrected before continuing.", LoggingLevel.Error); MessageBox.Show("Unable to validate server certificate, this issue must be corrected before continuing.", AppName, MessageBoxButton.OK, MessageBoxImage.Error); SubsonicClient = null; } else { SubsonicServer = UseProxy ? new SubsonicServer(serverUri, Username, Password, ClientName, proxyUri, ProxyPort, ProxyUsername, ProxyPassword) : new SubsonicServer(serverUri, Username, Password, ClientName); SubsonicClient = new SubsonicClient(SubsonicServer, new ImageFormatFactory()); SubsonicClient.PingAsync(GetCancellationToken("InitSubsonicApi")).ContinueWith(ValidateServerVersion); } }