mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 13:33:27 -07:00
Some small fixes for different parts of code.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2087 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
3411432a0e
commit
a5f900f92e
5 changed files with 79 additions and 29 deletions
|
@ -114,8 +114,18 @@ namespace GreenshotPlugin.Core {
|
|||
/// <param name="key"></param>
|
||||
/// <param name="value"></param>
|
||||
public void Add(TK key, TV value) {
|
||||
Add(key, value, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a value to the cache
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <param name="secondsToExpire?">optional value for the seconds to expire</param>
|
||||
public void Add(TK key, TV value, int? secondsToExpire) {
|
||||
lock (lockObject) {
|
||||
var cachedItem = new CachedItem(key, value, secondsToExpire);
|
||||
var cachedItem = new CachedItem(key, value, secondsToExpire.HasValue ? secondsToExpire.Value : this.secondsToExpire);
|
||||
cachedItem.Expired += delegate(TK cacheKey, TV cacheValue) {
|
||||
if (internalCache.ContainsKey(cacheKey)) {
|
||||
LOG.DebugFormat("Expiring object with Key: {0}", cacheKey);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue