Corrected various spelling errors in code.

This commit is contained in:
Taloth Saldono
2014-04-11 00:19:40 +02:00
parent 326ecf1c14
commit ed99fa8698
19 changed files with 23 additions and 23 deletions

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using NzbDrone.Common.EnsureThat;
namespace NzbDrone.Common.Cache
{
public interface ICacheManager
{
ICached<T> GetCache<T>(Type host, string name);
ICached<T> GetCache<T>(Type host);
void Clear();
ICollection<ICached> Caches { get; }
}
public class CacheManager : ICacheManager
{
private readonly ICached<ICached> _cache;
public CacheManager()
{
_cache = new Cached<ICached>();
}
public ICached<T> GetCache<T>(Type host)
{
Ensure.That(host, () => host).IsNotNull();
return GetCache<T>(host, host.FullName);
}
public void Clear()
{
_cache.Clear();
}
public ICollection<ICached> Caches { get { return _cache.Values; } }
public ICached<T> GetCache<T>(Type host, string name)
{
Ensure.That(host, () => host).IsNotNull();
Ensure.That(name, () => name).IsNotNullOrWhiteSpace();
return (ICached<T>)_cache.Get(host.FullName + "_" + name, () => new Cached<T>());
}
}
}