public void Remove(EnterpriseCounter counter)
 {
     _lock.AcquireWriterLock(-1);
     List.Remove(counter);
     ClearCache();
     _lock.ReleaseWriterLock();
 }
 public EnterpriseCounter this[int index]
 {
     get
     {
         _lock.AcquireReaderLock(-1);
         EnterpriseCounter theItem = (EnterpriseCounter)List[index];
         _lock.ReleaseReaderLock();
         return(theItem);
     }
     set
     {
         _lock.AcquireWriterLock(-1);
         List[index] = value;
         ClearCache();
         _lock.ReleaseWriterLock();
     }
 }
        public void Add(EnterpriseCounter counter)
        {
            // have we already added it?
            EnterpriseCounter existing = Find(counter.Name);

            if (existing != null)
            {
                return;
            }



            // add it...
            _lock.AcquireWriterLock(-1);
            List.Add(counter);
            ClearCache();
            _lock.ReleaseWriterLock();
        }
        public EnterpriseCounter Find(string name)
        {
            // do we have a cache?
            CheckCacheExists();



            // loop...
            _lock.AcquireReaderLock(-1);
            EnterpriseCounter found = (EnterpriseCounter)_cache[name.ToLower()];

            _lock.ReleaseReaderLock();



            // return...
            return(found);
        }
        public void Add(EnterpriseCounter counter)
        {
            // have we already added it?
            EnterpriseCounter existing = Find(counter.Name);
            if(existing != null)
                return;

            // add it...
            _lock.AcquireWriterLock(-1);
            List.Add(counter);
            ClearCache();
            _lock.ReleaseWriterLock();
        }
 public void Remove(EnterpriseCounter counter)
 {
     _lock.AcquireWriterLock(-1);
     List.Remove(counter);
     ClearCache();
     _lock.ReleaseWriterLock();
 }