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

📄 gallerycategoryrsswriter.cs

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

using System.Collections;
using CommunityServer.Components;

namespace CommunityServer.Galleries.Components
{
	/// <summary>
	/// Generates an XML feed by a specific category
	/// </summary>
	public class GalleryCategoryRssWriter : GalleryRssWriter
	{

		protected ArrayList categories;

		public GalleryCategoryRssWriter(ArrayList categories, Gallery gallery, string baseUrl) : base(new ArrayList(), gallery, baseUrl)
		{
			this.categories = categories;
		}

        //Should we support enclosures?
        protected override string EnclosureUrl(PostAttachmentMetaData pa)
        {
            return null;
        }

        protected override void WritePostEnclosure(Post p)
        {
            
        }

		/// <summary>
		/// Appends the CategoryName to Title element
		/// </summary>
		protected override string Title
		{
			get
			{
				return string.Concat(base.Title, " : ", Category.Name);
			}
		}

		protected override void WriteChannel()
		{
			foreach(PostCategory c in categories)
			{
				Category = c;
				// Determine whether to write Categories or Tags to the RSS feed
				if (CurrentGallery.CategorizationType == CategorizationType.Album)
					BuildChannel(GalleryUrls.Instance().ViewCategory(CurrentGallery.ApplicationKey, c.CategoryID), c.Description, CurrentGallery.DefaultLanguage);
				else
					BuildChannel(GalleryUrls.Instance().TagsBrowser(CurrentGallery.ApplicationKey, new string[] {c.Name}), string.Format("{0}: {1}", ResourceManager.GetString("Tags"), c.Name), CurrentGallery.DefaultLanguage);
			}
		}

		protected override bool AllowComments
		{
			get
			{
				return base.AllowComments && CurrentGallery.EnableCommentsDefault;
			}
		}


	}
}

⌨️ 快捷键说明

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