postset.cs

来自「本系统是在asp版《在线文件管理器》的基础上设计制作」· CS 代码 · 共 79 行

CS
79
字号
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Collections;

namespace CommunityServer.Components {

    /// <summary>
    /// Summary description for UserSet.
    /// </summary>
    public class PostSet {

        ArrayList posts = new ArrayList();
        ArrayList replies = null;
        Post post =null;
        int totalRecords = 0;

        public int TotalRecords {
            get {
                return totalRecords;
            }
            set {
                totalRecords = value;
            }
        }

        public ArrayList Posts {
            get {
                return posts;
            }
        }

        public bool HasResults {
            get {
                if (posts.Count > 0)
                    return true;
                return false;
            }
        }

        public Post ThreadStarter
        {
            get{return post;}
        }

        public ArrayList Replies
        {
            get{ return replies;}
        }

        public bool Organize()
        {
            if(replies == null)
            {
                replies = new ArrayList();
                foreach(Post p in posts)
                {
                    if(p.PostLevel != 1)
                    {
                        replies.Add(p);
                    }
                    else
                    {
                        post = p;
                    }
                }
            }
            //No need to use the organized posts if the main
            //partent can not be found
            return ThreadStarter != null;
        }
        
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?