Esempio n. 1
0
 /// <summary>
 /// Clears the statistics for a specified site.
 /// </summary>
 /// <param name="site">The site.</param>
 public void Clear(string site)
 {
     if (_siteList.ContainsKey(site))
     {
         //_siteList.Remove(site);
         SiteStatistics stats = _siteList[site];
         stats.Clear();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Gets the statistics for a specified site.
        /// </summary>
        /// <param name="site">The site.</param>
        /// <returns>site statistics</returns>
        public SiteStatistics Get(string site)
        {
            SiteStatistics stats = null;

            if (_siteList != null)
            {
                stats = _siteList[site];
            }

            return(stats);
        }
Esempio n. 3
0
        /// <summary>
        /// Adds to the statistics for a specified site.
        /// </summary>
        /// <param name="site">The site.</param>
        /// <param name="pages">The pages.</param>
        /// <param name="bytes">The bytes.</param>
        public void Add(string site, int pages, int bytes, TimeSpan time)
        {
            SiteStatistics stats;

            if (_siteList == null)
            {
                _siteList = new Dictionary <string, SiteStatistics>();
            }

            if (_siteList.ContainsKey(site))
            {
                stats = _siteList[site];
                stats.Add(pages, bytes, time);
            }
            else
            {
                stats = new SiteStatistics(site);
                stats.Add(pages, bytes, time);
                _siteList.Add(site, stats);
            }
        }