forumrepeater.cs

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

CS
95
字号
//------------------------------------------------------------------------------
// <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 + =
减小字号Ctrl + -
显示快捷键?