1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-21 22:05:43 -04:00

Updated to exceptron api v1a

This commit is contained in:
kay.one
2012-04-29 18:24:24 -07:00
parent bb9e4c88ce
commit 16eecb3b4f
46 changed files with 52399 additions and 32 deletions
@@ -0,0 +1,39 @@
//http://fastjson.codeplex.com/
using System.Collections.Generic;
namespace Exceptron.Driver.fastJSON
{
internal class SafeDictionary<TKey, TValue>
{
private readonly object _Padlock = new object();
private readonly Dictionary<TKey, TValue> _Dictionary = new Dictionary<TKey, TValue>();
public bool TryGetValue(TKey key, out TValue value)
{
return _Dictionary.TryGetValue(key, out value);
}
public TValue this[TKey key]
{
get
{
return _Dictionary[key];
}
}
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
{
return ((ICollection<KeyValuePair<TKey, TValue>>)_Dictionary).GetEnumerator();
}
public void Add(TKey key, TValue value)
{
lock (_Padlock)
{
if (_Dictionary.ContainsKey(key) == false)
_Dictionary.Add(key, value);
}
}
}
}