示例#1
0
 public void StopCounter(int counterId)
 {
     if (counterId <= 0)
     {
         return;
     }
     lock (_counters)
     {
         ViewModelPerformanceCounter c = getCounter(counterId);
         c.Stop();
     }
 }
示例#2
0
        public void UnregisterCounter(int counterId)
        {
            bool nullWarning = false;

            if (counterId < 0)
            {
                return;
            }
            lock (_counters)
            {
                ViewModelPerformanceCounter c = getCounter(counterId);
                if (c == null)
                {
                    nullWarning = true;
                }
                else
                {
                    c.Stop();
                    _counters.Remove(c);
                }
                System.Diagnostics.Debug.Assert(!nullWarning);
            }
        }