gallerytagsrsswriter.cs

来自「community server 源码」· CS 代码 · 共 48 行

CS
48
字号
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

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


namespace CommunityServer.Galleries.Components
{
	/// <summary>
	/// Generates an XML feed for specific tag(s)
	/// </summary>
	public class GalleryTagsRssWriter : GalleryRssWriter
	{

		protected string[] Tags = null;
		protected string Description = string.Empty;
	
		public GalleryTagsRssWriter(ArrayList posts, Gallery gallery, string baseUrl, string[] tags) : base(posts, gallery, baseUrl)
		{
			Tags = tags;
			Description = string.Format("{0}: {1}", ResourceManager.GetString("Tags"), string.Join(", ", Tags));
		}


		/// <summary>
		/// Appends the Tag names to Title element
		/// </summary>
		protected override string Title
		{
			get
			{
				return string.Concat(base.Title, " : ", string.Join(", ", Tags));
			}
		}

		protected override void WriteChannel()
		{
			BuildChannel(GalleryUrls.Instance().TagsBrowser(CurrentGallery.ApplicationKey, Tags), Description, CurrentGallery.DefaultLanguage);
		}

	}
}

⌨️ 快捷键说明

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