⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 post.cs

📁 本系统是在asp版《在线文件管理器》的基础上设计制作
💻 CS
📖 第 1 页 / 共 2 页
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Drawing;
using System.Text.RegularExpressions;

using CSC = CommunityServer.Components;

namespace CommunityServer.Components {

    // *********************************************************************
    //
    //  Post
    //
    /// <summary>
    /// This class contains the properties that describe a Post.
    /// </summary>
    //
    // ********************************************************************/
	[Serializable]
	public abstract class Post : ExtendedAttributes {

        int postID = 0;				    // the unique ID for the post
        int threadID = 0;				// the ID indicating what thread the post belongs to
        int parentID = 0;				// indicates the thread's parent - 0 if the post is an original post
        int forumID = 0;				// indicates the forum the thread was posted to
		int emoticonID = 0;
        int postLevel = 0;				// indicates the postlevel - i.e., how many replies deep the thread is
        int sortOrder = 0;				// indicates the order the thread is sorted
        int replies = 0;				// how many replies this posting has received
        int views = 0;                  // Total times the post has been viewed
        int prevThreadID = 0;             // Previous thread
        int nextThreadID = 0;             // Next thread
        String username = "";			// uniquely identifies the user who posted the post
        int indexInThread = 0;          // The index of the post relative to the thread
        String subject = "";			// the subject of the post
        string userHostAddress = "000.000.000.000";
        string body;				    // The body of the post, in raw format
        string formattedBody;           // Formatted body
        string editNotes;               // Edit notes associated with the post
        DateTime postDate;				// the date the post was made
        DateTime threadDate;			// the date of the thread (the postDate of the most recent post to the thread)
        bool approved = true;			// whether or not the post is approved
        bool islocked = false;          // whether or not the post allows replies
        bool hasRead = false;           // whether or not the post has been read by the user
        bool isTracked = false;         // whether or not the post is being tracked by the user
        string attachmentFilename;      
        User user;
        
        PostType postType = PostType.BBCode;
        ArrayList ratings;
        int postConfiguration = 0; // bitwise mask 


        public string UserHostAddress {
            get {
                return userHostAddress;
            }
            set {
                userHostAddress = value;
            }
        }

        public int EmoticonID {
            get {
                return emoticonID;
            }
            set {
                emoticonID = value;
            }
        }

        public string AttachmentFilename {
            get {
                return attachmentFilename;
            }
            set {
                attachmentFilename = value;
            }
        }

        public bool HasAttachment {
            get {
                if (attachmentFilename != String.Empty)
                    return true;

                return false;
            }
        }


        // *********************************************************************
        //
        //  User
        //
        /// <summary>
        /// User that created this post.
        /// </summary>
        //
        // ********************************************************************/
        public User User {
            get {
                return user;
            }
            set {
                user = value;
            }
        }

        public int IndexInThread {
            get {
                return indexInThread;
            }
            set {
                indexInThread = value;
            }
        }

        // *********************************************************************
        //
        //  PostID
        //
        /// <summary>
        /// Specifies the ID of the Post, the unique identifier.
        /// </summary>
        //
        // ********************************************************************/
        public int PostID {
            get { 
                return postID; 
            }

            set {
                if (value < 0)
                    postID = 0;
                else
                    postID = value;
            }
        }

        public PostType PostType {
            get {
                return postType;
            }
            set {
                postType = value;
            }
        }

        // *********************************************************************
        //
        //  IsLocked
        //
        /// <summary>
        /// Whether or not this post allows replies
        /// </summary>
        //
        // ********************************************************************/
        public bool IsLocked {
            get { return this.islocked; }
            
            set {
                islocked = value;
            }
        }

        // *********************************************************************
        //
        //  HasRead
        //
        /// <summary>
        /// Whether or not this post allows replies
        /// </summary>
        //
        // ********************************************************************/
        public bool HasRead {
            get { return hasRead; }
            
            set {
                hasRead = value;
            }
        }


        // *********************************************************************
        //
        //  IsTracked
        //
        /// <summary>
        /// Whether or not this post allows replies
        /// </summary>
        //
        // ********************************************************************/
        public virtual bool IsTracked {
            get { return isTracked; }
            
            set {
                isTracked = value;
            }
        }


        // *********************************************************************
        //
        //  Views
        //
        /// <summary>
        /// Total number of views for a given post
        /// </summary>
        //
        // ********************************************************************/
        public int Views {
            get { return this.views; }
            
            set {
                views = value;
            }
        }

        // *********************************************************************
        //
        //  ThreadID
        //
        /// <summary>
        /// Indicates what thread the Post belongs to.
        /// </summary>
        //
        // ********************************************************************/
        public int ThreadID {
            get { return threadID; }
            set {
                if (value < 0)
                    threadID = 0;
                else
                    threadID = value;
            }
        }

        // *********************************************************************
        //
        //  ThreadIDNext
        //
        /// <summary>
        /// Indicates what thread the Post belongs to.
        /// </summary>
        //
        // ********************************************************************/
        public int ThreadIDNext {
            get { return nextThreadID; }
            set {
                if (value < 0)
                    nextThreadID = 0;
                else
                    nextThreadID = value;
            }
        }

        // *********************************************************************
        //
        //  ThreadIDPrev
        //
        /// <summary>
        /// Indicates what thread the Post belongs to.
        /// </summary>
        //
        // ********************************************************************/
        public int ThreadIDPrev {
            get { return prevThreadID; }
            set {
                if (value < 0)
                    prevThreadID = 0;
                else
                    prevThreadID = value;
            }
        }

        // *********************************************************************
        //
        //  ParentID
        //
        /// <summary>
        /// Specifies the thread's parent ID.  (That is, the PostID of the replied-to post.)
        /// </summary>
        //
        // ********************************************************************/
        public int ParentID {
            get { return parentID; }
            set {
                if (value < 0)
                    parentID = 0;
                else
                    parentID = value;
            }

⌨️ 快捷键说明

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