コード例 #1
0
        public ThreadCollectionV5(ThreadCollectionV5 threads)
        {
            if (threads == null)
            {
                return;
            }

            foreach (BasicThread thread in threads)
            {
                this.Add(thread);
            }
        }
コード例 #2
0
ファイル: Forum.cs プロジェクト: zhangbo27/bbsmax
        private BasicThread ProcessLastThread(BasicThread thread, string key)
        {
            if (thread.ThreadStatus == ThreadStatus.Recycled || thread.ThreadStatus == ThreadStatus.UnApproved)
            {
                //PostBOV5.Instance.ClearTopThreadsCache(ForumID);
                ThreadCachePool.ClearAllCache();
                ThreadCollectionV5 threads = PostBOV5.Instance.GetTopThreads(ForumID);
                if (threads != null && threads.Count > 0)
                {
                    thread       = threads[0];
                    LastThreadID = thread.ThreadID;
                }
                else
                {
                    LastThreadID = 0;
                    return(null);
                }
            }
            if (thread.ThreadType == ThreadType.Join || thread.ThreadType == ThreadType.Move)
            {
                int threadID;
                if (int.TryParse(thread.Subject.Substring(0, thread.Subject.IndexOf(',')), out threadID))
                {
                    thread = PostBOV5.Instance.GetThread(threadID);
                    if (thread == null)
                    {
                        return(null);
                    }
                }
                else
                {
                    return(null);
                }
            }
            if (thread != null)
            {
                PageCacheUtil.Set(key, thread);
            }

            return(thread);
        }