private static void AddToDictionary(TokenCache tokenCache, TokenCacheKey key, AuthenticationResult value) { tokenCache.OnBeforeAccess(null); tokenCache.OnBeforeWrite(null); tokenCache.tokenCacheDictionary.Add(key, value); tokenCache.HasStateChanged = true; tokenCache.OnAfterAccess(null); }
private static bool RemoveFromDictionary(TokenCache tokenCache, TokenCacheKey key) { bool result; tokenCache.OnBeforeAccess(null); tokenCache.OnBeforeWrite(null); result = tokenCache.tokenCacheDictionary.Remove(key); tokenCache.HasStateChanged = true; tokenCache.OnAfterAccess(null); return result; }
private static bool RemoveFromDictionary(TokenCache tokenCache, TokenCacheKey key) { tokenCache.OnBeforeAccess(new TokenCacheNotificationArgs { TokenCache = tokenCache }); tokenCache.OnBeforeWrite(new TokenCacheNotificationArgs { TokenCache = tokenCache }); bool result = tokenCache.tokenCacheDictionary.Remove(key); tokenCache.HasStateChanged = true; tokenCache.OnAfterAccess(new TokenCacheNotificationArgs { TokenCache = tokenCache }); return result; }