Exemple #1
0
 public static void RemoveRef(string depKey)
 {
     try
     {
         DependencyItemState item = _depItems[depKey];
         Interlocked.Decrement(ref item.RefCount);
     }
     catch (KeyNotFoundException ex)
     {
     }
 }
Exemple #2
0
 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");
     }
 }