public object Clone() { CertCacheItem item = new CertCacheItem() { Token = this.Token.Clone() as AuthToken, apis = this.apis.CloneList() as List<api> }; return item; }
public void DeleteToken(string token) { CertCacheItem item = GetCacheToken(token); if (item != null) { tempmanagecache.Remove(item); SetCertCahe(); } }
public object Clone() { CertCacheItem item = new CertCacheItem() { Token = this.Token.Clone() as AuthToken, apis = this.apis.CloneList() as List <api> }; return(item); }
public bool SetCacheApis(string token, List <api> apis) { CertCacheItem item = GetCacheToken(token); if (item == null) { return(false); } item.apis = apis; SetCertCahe(); return(true); }
public CertCacheItem GetCacheToken(string token) { CertCacheItem t_tokenitem = null; try { t_tokenitem = tempmanagecache.FirstOrDefault(x => x.Token.token == token); if (t_tokenitem == null) { return(null); } } catch { } return(t_tokenitem); }
public void AddOrUpdateToken(AuthToken Token) { CertCacheItem t_tokenitem = null; Token.lastauth = DateTime.Now;//上次请求certcennt的时间。 t_tokenitem = tempmanagecache.FirstOrDefault(x => x.Token.token == Token.token); if (t_tokenitem == null) { tempmanagecache.Add(new CertCacheItem() { Token = Token }); } else { t_tokenitem.Token = Token; } SetCertCahe(); }