Inheritance: ICounter
Example #1
0
        internal void Increment(string key)
        {
            lock (countLock) {
                ICounter counter;
                if (!counters.TryGetValue(key, out counter))
                    counters[key] = counter = new Counter(key, null);

                if (counter is Counter)
                    ((Counter) counter).Increment();
            }
        }
Example #2
0
 internal void SetValue(string key, object value)
 {
     lock (countLock) {
         if (!counters.ContainsKey(key))
             counters[key] = new Counter(key, value);
     }
 }