public float? ReportValue()
{
// AppPool not found -> is not started.
if (string.IsNullOrEmpty(this.counterName) && !LoadCounterName())
return null;
if (this.counterListener == null)
{
try
{
this.counterListener = new CounterListener(category, this.counterName, counter);
}
catch (InvalidOperationException)
{
}
}
if (this.counterListener == null)
return null;
try
{
return this.counterListener.ReportValue(); ;
}
catch (InvalidOperationException)
{
// counter not available.
this.counterListener = null;
return null;
}
}