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

📄 createeditforum.cs

📁 微软的.NET论坛的源代码(COOL!!!)
💻 CS
📖 第 1 页 / 共 2 页
字号:
                if (ViewState["headerMessage"] == null) {
                    if (Mode == CreateEditForumMode.CreateForum)
                        return defaultCreateHeaderMessage;
                    else
                        return defaultEditHeaderMessage;
                }

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

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

        }

        // *********************************************************************
        //  ForumNameWarningMessage
        //
        /// <summary>
        /// Specifies the warning message to return if the user does not specify
        /// a title for the Forum (which is a required field).
        /// </summary>
        //
        // ********************************************************************/
        public String ForumNameWarningMessage {

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

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

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

        }

        // *********************************************************************
        //  ForumNameColumns
        //
        /// <summary>
        /// Specifies how many columns to allow for the forum title text box.
        /// </summary>
        //
        // ********************************************************************/
        public int ForumNameColumns {
            get  {
                if (ViewState["forumNameCols"] == null) 
                    return defaultForumNameCols;

                return (int) ViewState["forumNameCols"];
            }

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

        }

        // *********************************************************************
        //  ForumDescriptionColumns
        //
        /// <summary>
        /// Indicates how many columns wide to make the forum description text box (a
        /// multi-line text box).  Defaults to 60.
        /// </summary>
        //
        // ********************************************************************/
        public int ForumDescriptionColumns {
            get {
                if (ViewState["forumDescCols"] == null) 
                    return defaultForumDescriptionCols;

                return (int) ViewState["forumDescCols"];
            }

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

        }
		
        // *********************************************************************
        //  ForumDescriptionRows
        //
        /// <summary>
        /// Specifies how many rows tall to make the forum description text box.  Defaults
        /// to 10.
        /// </summary>
        //
        // ********************************************************************/
        public int ForumDescriptionRows {
            get {
                if (ViewState["forumDescRows"] == null) 
                    return defaultForumDescriptionRows;

                return (int) ViewState["forumDescRows"];
            }

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

        }

        // *********************************************************************
        //  ForumDescriptionWarningMessage
        //
        /// <summary>
        /// Specifies the warning message to display if the user does not enter a
        /// forum description, which is a required field.
        /// </summary>
        //
        // ********************************************************************/
        public String ForumDescriptionWarningMessage {
            get {
                if (ViewState["forumDescWarningMsg"] == null) 
                    return defaultForumDescriptionWarningMessage;

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

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

        }

        // *********************************************************************
        //  RedirectUrl
        //
        /// <summary>
        /// Indicates the Url to send the user to once they create or update the forum.  Defaults
        /// to ./, which sends the user back to the default document in the current directory.
        /// </summary>
        //
        // ********************************************************************/
        public String RedirectUrl {

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

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

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

        }

        // *********************************************************************
        //  RedirectUrl
        //
        /// <summary>
        /// Specifies the mode for the Web control.  This property can have one of two
        /// values: CreateForum or EditForum.  When the Mode is set to CreateForum, the
        /// Web control allows the user to create a new forum; when it's set to
        /// EditForum, the user is allowed to edit an existing forum (in which case the
        /// ForumID must be set to the forum to be edited).
        /// <seealso cref="ForumID"/>
        /// </summary>
        /// <remarks>
        /// If Mode is set to EditForum and the ForumID property is not set,
        /// an Exception will be thrown.
        /// </remarks>
        //
        // ********************************************************************/
        public CreateEditForumMode Mode {
            get {
                if (ViewState["mode"] == null) 
                    return CreateEditForumMode.CreateForum;

                return (CreateEditForumMode) ViewState["mode"];
            }

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

        // *********************************************************************
        //  DefaultModerationOption
        //
        /// <summary>
        /// Indicates whether or not forums, when created, are moderated by default or not.
        /// If this property is set to true (the default) when a new forum is created, the
        /// Moderated checkbox will be checked initially.  If this is false, this checkbox will
        /// be unchecked.
        /// </summary>
        //
        // ********************************************************************/
        public bool DefaultModerationOption {
            get {
                if (ViewState["defaultModOption"] == null) 
                    return defaultModerationOption;

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

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

        // *********************************************************************
        //  DefaultActiveOption
        //
        /// <summary>
        /// Indicates whether or not forums, when created, are active by default or not.
        /// If this property is set to true (the default) when a new forum is created, the
        /// Active checkbox will be checked initially.  If this is false, this checkbox will
        /// be unchecked.
        /// </summary>
        //
        // ********************************************************************/
        public bool DefaultActiveOption {
            get {
                if (ViewState["defaultActiveOption"] == null) 
                    return defaultActiveOption;

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

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

        // *********************************************************************
        //  ForumID
        //
        /// <summary>
        /// The ForumID of the forum to edit.  For use when Mode is set to EditForum.
        /// <seealso cref="Mode"/>
        /// </summary>
        /// <remarks>
        /// If Mode is set to EditForum and this property is not set, an Exception
        /// will be thrown.
        /// </remarks>
        //
        // ********************************************************************/
        public int ForumID {
            get {
                if (ViewState["forumID"] == null) 
                    return -1;

                return (int) ViewState["forumID"];
            }

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

        // *********************************************************************
        //  CheckUserPermissions
        //
        /// <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 + -