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

📄 adminforumpostlisting.cs

📁 微软的.NET论坛的源代码(COOL!!!)
💻 CS
📖 第 1 页 / 共 3 页
字号:
        /// <summary>
		/// Specifies the forum whose posts you wish to administer.
		/// </summary>
		/// <remarks>
		/// If ForumID is not specified, an Exception will be thrown.
		/// </remarks>
		/// 
		// ********************************************************************/

        [
            Bindable(true),
            Category("Required"),
            DefaultValue(""),
            Description("Specifies the Forum whose posts you wish to administer.")
        ]
        public int ForumID {

            get {
                // the forumID is stuffed in the ViewState so that
                // it is persisted across postbacks.
                if (ViewState["forumID"] == null)
                    return -1;		// if it's not found in the ViewState, return the default value

                return Convert.ToInt32(ViewState["forumID"].ToString());
            }

            set {
                // set the viewstate
                ViewState["forumID"] = value;
            }

        }
		
        // *********************************************************************
        //
        //  ViewOptions
        //
        /// <summary>
        /// Specifies the mode in which to view the forum's posts.
        /// </summary>
        /// <remarks>It is highly recommended that you either choose Flat or leave the default, Threaded,
        /// as the option.  Choosing Mixed will hide some messages.  Also, note that the end user's
        /// Forum View preferences are not taken into consideration when rendering the AdminForumPostListing
        /// Web control. </remarks>
        //
        // ********************************************************************/
        [
            Bindable(true),
            Category("Appearance"),
            DefaultValue("Threaded"),
            Description("Specifies the mode in which to view the forum's posts.")
        ]
        public ViewOptions ViewMode {

            get {
                // the ViewMode is stuffed in the ViewState so that
                // it is persisted across postbacks.
                if (ViewState["viewMode"] == null)
                    return defaultViewOptions;

                return ((ViewOptions) ViewState["viewMode"]);
            }

            set {
                // set the viewstate
                ViewState["viewMode"] = value;
            }

        }

        // *********************************************************************
        //
        //  ViewOptions
        //
        /// <summary>
        /// When a post is clicked, the administrator will be taken to view the post.  Use this property
        /// to specify if the post should be loaded in a particular frame.
        /// </summary>
        /// 
        // ********************************************************************/
        [
            Bindable(true),
            Category("Appearance"),
            DefaultValue(""),
            Description("Specifies if the post should be loaded in a particular frame.")
        ]
        public String FrameToOpenPosts {

            get {
                if (ViewState["frameToOpenPosts"] == null) 
                    return "";

                return (String) ViewState["frameToOpenPosts"];
            }

            set { 
                ViewState["frameToOpenPosts"] = value; 
            }
        }

        // *********************************************************************
        //
        //  ShowForumTitle
        //
        /// <summary>
        /// Indicates whether or not to display the Forum's title.
        /// </summary>
        /// 
        // ********************************************************************/
        [
            Bindable(true),
            Category("Appearance"),
            DefaultValue("True"),
            Description("Indicates whether or not to display the Forum's title.")
        ]
        public bool ShowForumTitle {
            get {
                if (ViewState["showForumTitle"] == null) 
                    return true;
                    
                return (bool) ViewState["showForumTitle"];
            }

            set { 
                ViewState["showForumTitle"] = value; 
            }
        }

        // *********************************************************************
        //
        //  ThreadSeparator
        //
        /// <summary>
        /// Specifies the HTML to use to separate each thread.  Defaults to a horizontal rule.
        /// </summary>
        /// <remarks>This property is only displayed when the ForumView property is set to Threaded (the
        /// default for this Web control).</remarks>
        /// 
        // ********************************************************************/
        [
            Bindable(true),
            Category("Appearance"),
            DefaultValue("<hr noshade size=\"1px\">"),
            Description("Specifies the HTML to use to separate each thread.")
        ]
        public String ThreadSeparator {
            get {
                if (ViewState["threadSeparator"] == null) 
                    return defaultThreadSeparator;
                   
                return (String) ViewState["threadSeparator"];
            }

            set { 
                ViewState["threadSeparator"] = value; 
            }
        }


        // *********************************************************************
        //
        //  IndentString
        //
        /// <summary>
        /// Specifies the HTML to use to indent each child post.
        /// </summary>
        /// <remarks>Only applicable when viewing the forum with the threaded ViewMode display.</remarks>
        //
        // ********************************************************************/
        [
            Bindable(true),
            Category("Appearance"),
            DefaultValue("&nbsp;&nbsp;&nbsp;&nbsp;"),
            Description("Specifies the HTML to use to indent each child post.")
        ]
        public String IndentString {
            get {
                if (ViewState["indentString"] == null) 
                    return defaultIndentString;
                    
                return (String) ViewState["indentString"];
            }

            set { 
                ViewState["indentString"] = value; 
            }

        }

        // *********************************************************************
        //
        //  EditPostIconUrl
        //
        /// <summary>
        /// Specifies the Url to the image to display for the ImageButton that, when clicked, will allow
        /// the end user to edit the post.
        /// </summary>
        /// <remarks>This setting should specify the image's Url path relative to the imagesPath
        /// setting in Web.config.</remarks>
        //
        // ********************************************************************/
        public String EditPostIconUrl {
            get {
                if (ViewState["editPostIconUrl"] == null) 
                    return defaultEditPostIconUrl;

                return (String) ViewState["editPostIconUrl"];
            }

            set { 
                ViewState["editPostIconUrl"] = value; 
            }

        }

        // *********************************************************************
        //
        //  DeletePostIconUrl
        //
        /// <summary>
        /// Specifies the Url to the image to display for the ImageButton that, when clicked, will allow
        /// the end user to delete the post.
        /// </summary>
        /// <remarks>This setting should specify the image's Url path relative to the imagesPath
        /// setting in Web.config.</remarks>
        /// 
        // ********************************************************************/
        public String DeletePostIconUrl {

            get {
                if (ViewState["deletePostIconUrl"] == null) 
                    return defaultDeletePostIconUrl;
                
                return (String) ViewState["deletePostIconUrl"]; 
            }

            set { 
                ViewState["deletePostIconUrl"] = value; 
            }
        }

        // *********************************************************************
        //
        //  ShowUsername
        //
        /// <summary>
        /// Determines whether or not to show the Username of the person who posted the message.
        /// </summary>
        /// 
        // ********************************************************************/
        public bool ShowUsername {
            get {
                if (ViewState["showUsername"] == null) 
                    return true;

                return (bool) ViewState["showUsername"];
            }

            set { 
                ViewState["showUsername"] = value; 
            }

        }

        // *********************************************************************
        //
        //  ShowDatePosted
        //
        /// <summary>
        /// Determines whether or not to show the date and time the messages was posted.
        /// </summary>
        ///
        // ********************************************************************/
        public bool ShowDatePosted {
            get {
                if (ViewState["showDatePosted"] == null) 
                    return true;

                return (bool) ViewState["showDatePosted"];
            }
            set { 
                ViewState["showDatePosted"] = value; 
            }
        }

        // *********************************************************************
        //
        //  DeletePost
        //
        /// <summary>
        /// This property allows the end developer to specify the stylistic and textual properties
        /// of the DeltePostStyle class.  These settings are reflected in the Confirm Delete page.
        /// </summary>
        ///
        // ********************************************************************/
        public DeletePostStyle DeletePost {
            get {	
                return deletePostStyle;	
            }
        }

        // *********************************************************************
        //
        //  DeletePost
        //
        /// <summary>
        /// Indicates if the Web control should check to verify that the user visiting the page
        /// is, indeed, a moderator.
        /// </summary>
        ///
        // ********************************************************************/
        public bool CheckUserPermissions {
            get {
                if (ViewState["checkUserPerm"] == null) 
                    return true;
                return (bool) ViewState["checkUserPerm"];

            }
   
            set { 
                ViewState["checkUserPerm"] = value; 
            }
        }

    }
}

⌨️ 快捷键说明

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