public void Set(string key, object value, CacheItemCallback callback) { SetInternal(key, value); if (callback != null) { callback(key, value); } }
public void Set(string key, object value, TimeSpan expires, CacheItemCallback callback) { CacheItem item = SetInternal(key, value); AppHost.AddTimeout(expires, RepeatBehavior.Single, item, HandleExpires); if (callback != null) { callback(key, value); } }
public void Remove(string key, CacheItemCallback callback) { CacheItem item; object value = null; if (items.TryGetValue (key, out item)) { item.IsRemoved = true; items.Remove (key); value = item.Item; } if (callback != null) callback (key, value); }
public void Get(string key, CacheItemCallback callback) { CacheItem item; object res = null; if (key == null) throw new ArgumentNullException ("key"); if (callback == null) throw new ArgumentNullException ("callback"); if (items.TryGetValue (key, out item)) res = item.Item; callback (key, res); }
public void Remove(string key, CacheItemCallback callback) { CacheItem item; object value = null; if (items.TryGetValue(key, out item)) { item.IsRemoved = true; items.Remove(key); value = item.Item; } if (callback != null) { callback(key, value); } }
public void Get(string key, CacheItemCallback callback) { CacheItem item; object res = null; if (key == null) { throw new ArgumentNullException("key"); } if (callback == null) { throw new ArgumentNullException("callback"); } if (items.TryGetValue(key, out item)) { res = item.Item; } callback(key, res); }
public void Set(string key, object value, TimeSpan expires, CacheItemCallback callback) { CacheItem item = SetInternal (key, value); AppHost.AddTimeout (expires, RepeatBehavior.Single, item, HandleExpires); if (callback != null) callback (key, value); }
public void Set(string key, object value, CacheItemCallback callback) { SetInternal (key, value); if (callback != null) callback (key, value); }