public static void RemoveRef(string depKey) { try { DependencyItemState item = _depItems[depKey]; Interlocked.Decrement(ref item.RefCount); } catch (KeyNotFoundException ex) { } }
public static void AddRef(string depKey) { try { DependencyItemState item = _depItems[depKey]; Interlocked.Increment(ref item.RefCount); } catch (KeyNotFoundException ex) { throw new DependencyKeyException("the dependencyKey is not supported"); } }