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

📄 gallerycommentrsshandler.cs

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

using System;
using CommunityServer.Components;

namespace CommunityServer.Galleries.Components
{
	/// <summary>
	/// Summary description for GalleryCommentRssHandler.
	/// </summary>
	public class GalleryCommentRssHandler : BaseGallerySyndicationHandler
	{
		public GalleryCommentRssHandler()
		{
			//
			// TODO: Add constructor logic here
			//
		}

		protected int PostID;

		protected override string CacheKey
		{
			get { return "CommentRss-PostID:" + PostID.ToString(); }
		}

		protected override void ProcessFeed()
		{
			PostID = Int32.Parse(Context.Request.QueryString["PostID"]);

			base.ProcessFeed ();
		}


		protected override CachedFeed BuildFeed()
		{
            GalleryThreadQuery query = new GalleryThreadQuery();
			query.PostID = PostID;
			query.ReturnFullThread = true;
			query.SectionID = this.CurrentGallery.SectionID;
			query.PageSize = GalleryConfig.RssDefaultThreadsPerFeed;

			PostSet ps =  GalleryPosts.GetPostSet(query) ;

			ps.Organize();

			GalleryPost we = ps.ThreadStarter as GalleryPost;

			//If we do not have a post, there is not much we can do
			if(we == null)
			{
				Context.Response.End();
				return null;
			}




			DateTime dt = (ps.Replies != null &&  ps.Replies.Count > 0) ? ((GalleryPost)(ps.Replies[ps.Replies.Count -1])).PostDate : we.PostDate;

			GalleryCommentRssWriter writer = new GalleryCommentRssWriter(we,ps.Replies,this.CurrentGallery,this.BaseUrl);
			return new CachedFeed(dt,dt.ToString(),writer.GetXml());
		}
	}
}

⌨️ 快捷键说明

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