private void timerRefreshHitRate_Tick(object sender, EventArgs e)
{
// No reason to refresh stats if we aren't looking at the cache page.
if (tabControl.SelectedTab.Name != "tabPageCache")
return;
hMailServer.Settings settings = APICreator.Application.Settings;
hMailServer.Cache cache = settings.Cache;
labelDomainHitRate.Text = cache.DomainHitRate.ToString();
labelAccountHitRate.Text = cache.AccountHitRate.ToString();
labelAliasHitRate.Text = cache.AliasHitRate.ToString();
labelDistributionListHitRate.Text = cache.DistributionListHitRate.ToString();
Marshal.ReleaseComObject(settings);
Marshal.ReleaseComObject(cache);
}