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

📄 baseforumsyndicationhandler.cs

📁 community server 源码
💻 CS
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Collections;
using CommunityServer.Components;

namespace CommunityServer.Discussions.Components
{
	/// <summary>
	/// Base class for all Forum Syndication feeds
	/// </summary>
	public abstract class BaseForumSyndicationHandler : BaseSyndicationHandler
	{

		protected ForumConfiguration _forumConfig;
		protected ForumConfiguration ForumConfig
		{
			get
			{
				if (_forumConfig == null)
					_forumConfig = ForumConfiguration.Instance();

				return _forumConfig;
			}
		}

		public BaseForumSyndicationHandler()
		{
		}

		/// <summary>
		/// The length of time the feed should be cached in seconds.
		/// </summary>
		protected override int CacheTime
		{
			get
			{
				return CSCache.SecondFactorCalculate(ForumConfig.RssCacheWindowInSeconds);
			}
		}

		/// <summary>
		/// The Fully Qualifed part of the Url for the current request
		/// </summary>
		protected override string BaseUrl
		{
			get { return Globals.HostPath(Context.Request.Url); }
		}


		private Forum _forum;
		protected override Section GetCurrentSection
		{
			get
			{
				if(_forum == null)
				{
					_forum = Forums.GetForum(CSContext.Current.SectionID, true, false);
					if(_forum == null)
						throw new CSException(CSExceptionType.SectionNotFound,"The forum could not be found");

					Permissions.AccessCheck(_forum,Permission.Read,CSContext.Current.User);
				}
				return _forum;
			}
		}


	}
}

⌨️ 快捷键说明

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