private void Refreshlist() { credentialList.Items.Clear(); SortedList <string, AuthenticationListItem> cache = new SortedList <string, AuthenticationListItem>(); using (SvnClient client = Context.GetService <ISvnClientPool>().GetClient()) { foreach (SvnAuthenticationCacheType tp in Enum.GetValues(typeof(SvnAuthenticationCacheType))) { if (tp == SvnAuthenticationCacheType.None) { continue; } foreach (SvnAuthenticationCacheItem i in client.Authentication.GetCachedItems(tp)) { if (i.RealmUri == null) { continue; // Just ignore local repositories } AuthenticationListItem lvi; if (!cache.TryGetValue(i.Realm, out lvi)) { cache[i.Realm] = lvi = new AuthenticationListItem(credentialList); } lvi.CacheItems.Add(i); } } } foreach (AuthenticationListItem i in cache.Values) { i.Refresh(); } credentialList.Items.AddRange(new List <AuthenticationListItem>(cache.Values).ToArray()); }
private void Refreshlist() { credentialList.Items.Clear(); ICollection<CredentialCacheItem> items = ConfigurationService.GetAllCredentialCacheItems(); foreach (CredentialCacheItem item in items) { AuthenticationListItem lvi = new AuthenticationListItem(credentialList); lvi.CacheItem = item; lvi.Refresh(); credentialList.Items.Add(lvi); } }