private void RemoveCredentialContainer(CredentialAuthorityContainer container) { List <CredentialAuthorityContainer> containerList; if (_credentials.TryGetValue(GetKey(container.Uri), out containerList)) { lock (_credentialLock) { containerList.Remove(container); _credentials[GetKey(container.Uri)] = containerList; } } }
private CredentialAuthorityContainer GetCredentialInternal(Uri uri, string authType) { CredentialAuthorityContainer credential = null; List <CredentialAuthorityContainer> container; if (_credentials.TryGetValue(GetKey(uri), out container)) { if (container.Count > 0) { if (string.IsNullOrWhiteSpace(authType)) { credential = container.FirstOrDefault(); } else { credential = container.FirstOrDefault( x => x.AuthenticationType.Equals(authType, StringComparison.OrdinalIgnoreCase)); } } } return(credential ?? CredentialAuthorityContainer.Default); }
private void RemoveCredentialContainer(CredentialAuthorityContainer container) { List<CredentialAuthorityContainer> containerList; if (_credentials.TryGetValue(GetKey(container.Uri), out containerList)) { lock (_credentialLock) { containerList.Remove(container); _credentials[GetKey(container.Uri)] = containerList; } } }