private static bool AllCountersFoundForWorker(ICounterExample counterCounterExample) { return true; var countersForWorker = counterCounterExample.GetCounterCreationData(); return countersForWorker.All( counter => { // the next line is always throwing a 'category doesnt exist' error :( if (!PerformanceCounterCategory.CounterExists(CounterCategory, counter.CounterName)) { return false; } return new PerformanceCounter(CounterCategory, counter.CounterName).CounterType == counter.CounterType; }); }
private static bool AllCountersFoundForWorker(ICounterExample counterCounterExample) { return(true); var countersForWorker = counterCounterExample.GetCounterCreationData(); return(countersForWorker.All( counter => { // the next line is always throwing a 'category doesnt exist' error :( if (!PerformanceCounterCategory.CounterExists(CounterCategory, counter.CounterName)) { return false; } return new PerformanceCounter(CounterCategory, counter.CounterName).CounterType == counter.CounterType; })); }