コード例 #1
0
        private static bool ClearTrackTopicQueue(TopicViewCollection <TopicView> tvc)
#endif
        {
            ProcessStats ps = new ProcessStats(tvc);

            ps.Enqueue();

            return(true);
        }
コード例 #2
0
 static TopicStats()
 {
     queuedStatsList  = null;
     queuedAllowCount = 20;
     if (GeneralConfigInfo.Current.TopicQueueStats == 1)
     {
         SetQueueCount();
     }
 }
コード例 #3
0
        //public static int UpdateTopicViewCount(int tid, int viewcount)
        //{
        //    return DatabaseProvider.GetInstance().UpdateTopicViewCount(tid, viewcount);
        //    //return BBX.Data.TopicStats.UpdateTopicViewCount(tid, viewcount);
        //}

        //public static bool TrackTopic(TopicView tv)
        //{
        //    return UpdateTopicViewCount(tv.TopicID, tv.ViewCount) == 1;
        //}

        public static void SetQueueCount()
        {
            if (GeneralConfigInfo.Current.TopicQueueStatsCount > 20 && GeneralConfigInfo.Current.TopicQueueStatsCount <= 1000)
            {
                queuedAllowCount = GeneralConfigInfo.Current.TopicQueueStatsCount;
            }
            if (queuedStatsList == null)
            {
                queuedStatsList = new TopicViewCollection <TopicView>();
            }
        }
コード例 #4
0
        /// <summary>
        /// 追踪主题
        /// </summary>
        /// <param name="tvc">主题浏览集合</param>
        /// <returns>成功返回true</returns>
        public static bool TrackTopic(TopicViewCollection <TopicView> tvc)
        {
            if (tvc == null)
            {
                return(false);
            }

            foreach (TopicView tv in tvc)
            {
                UpdateTopicViewCount(tv.TopicID, tv.ViewCount);
            }
            return(true);
        }
コード例 #5
0
 static bool TrackTopic(TopicViewCollection <TopicView> tvc)
 {
     if (tvc == null)
     {
         return(false);
     }
     foreach (var item in tvc)
     {
         //UpdateTopicViewCount(item.TopicID, item.ViewCount);
         Topic.UpdateViewCount(item.TopicID, item.ViewCount);
     }
     return(true);
 }
コード例 #6
0
        /// <summary>
        /// 设置队列长度
        /// </summary>
        public static void SetQueueCount()
        {
            if (GeneralConfigs.GetConfig().TopicQueueStatsCount > 20 && GeneralConfigs.GetConfig().TopicQueueStatsCount <= 1000)
            {
                queuedAllowCount = GeneralConfigs.GetConfig().TopicQueueStatsCount;
            }

            if (queuedStatsList == null)
            {
#if NET1
                queuedStatsList = new TopicViewCollection();
#else
                queuedStatsList = new TopicViewCollection <TopicView>();
#endif
            }
        }
コード例 #7
0
 public ProcessStats(TopicViewCollection <TopicView> tvc)
 {
     _tvc = tvc;
 }
コード例 #8
0
 /// <summary>
 /// 清除追踪主题的队列
 /// </summary>
 /// <param name="tvc">主题浏览集合</param>
 /// <returns>成功返回true</returns>
 private static bool ClearTrackTopicQueue(TopicViewCollection <TopicView> tvc)
 {
     new ProcessStats(tvc).Enqueue();
     return(true);
 }
コード例 #9
0
 public ProcessStats(TopicViewCollection tvc)
コード例 #10
0
        /// <summary>
        /// 追踪主题
        /// </summary>
        /// <param name="tvc">主题浏览集合</param>
        /// <returns>成功返回true</returns>
#if NET1
        public static bool TrackTopic(TopicViewCollection tvc)
コード例 #11
0
        /// <summary>
        /// 清除追踪主题的队列
        /// </summary>
        /// <param name="tvc">主题浏览集合</param>
        /// <returns>成功返回true</returns>
#if NET1
        private static bool ClearTrackTopicQueue(TopicViewCollection tvc)