public void StopCounter(int counterId) { if (counterId <= 0) { return; } lock (_counters) { ViewModelPerformanceCounter c = getCounter(counterId); c.Stop(); } }
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); } }