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

📄 forumrepeater.cs

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

using System;
using System.Collections;using CommunityServer.Components;using CommunityServer.Controls;
using CommunityServer.Discussions.Components;

namespace CommunityServer.Discussions.Controls 
{


    /// <summary>
    /// Provides a forum specific implementation of SectionRepeater
    /// </summary>
    public class ForumRepeater : SectionRepeater
    {
        CSContext csContext = CSContext.Current;

        /// <summary>
        /// Returns the Valid Sections based on the Mode setting
        /// </summary>
        /// <returns></returns>
        protected override ArrayList GetSections()
        {
            ArrayList forums = null;

			//NOTE: ScottW >> Remove try/catch that through SectionNotFound excpetion on every exception.

            // Bind the repeater to the collection returned by the GetForums()
            //
                // Are we in normal mode or moderation mode?
                //
                switch ( this.Mode ) 
                {

                    case ControlUserMode.Moderator:
                        forums = Moderate.GetForumsByForumGroupID (GroupID);
                        break;

                    default:
                        // Do we have a forumID specified?
                        //
                        if ( (GroupID == -1) && (csContext.ForumID > 0) ) 
                        {

                            // Does the specified forum have any sub-forums?
                            //
                            Forum forum = (Forum) Forums.GetForum(csContext.ForumID);

                            if (forum.Sections.Count > 0) 
                            {

                                // Get the forums for the named group
                                //
                                forum = Forums.GetForum(csContext.ForumID);

                                // Now get the sub-forums for the current forum
                                //
                                forums = forum.Sections;
                            }

                        } 
                        else if (GroupID == -1) 
                        {
                            return new ArrayList();
                        } 
                        else 
                        {
                            if ( Mode == ControlUserMode.Administrator) 
                            {
                                forums = Forums.GetForumsByForumGroupID(GroupID, false, IgnorePermissions, this.FlushSections);
                            } 
                            else 
                            {
                                forums = Forums.GetForumsByForumGroupID(GroupID, true, IgnorePermissions);
                            }
                        }
                        break;
                }

            
            return forums;
        }
        

    }

}

⌨️ 快捷键说明

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