Feeds/FeedBuilder.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Syndication;
using System.Xml;
using System.IO;
namespace ComLib.Feeds
{
/// <summary>
/// Helper class for build feeds.
/// </summary>
public class FeedBuilder
{
/// <summary>
/// Build the feed using the IPublishable items.
/// </summary>
/// <param name="feedAuthor">The author of the feed.</param>
/// <param name="feedTitle">The title of the feed</param>
/// <param name="feedDescription">The description of the feed.</param>
/// <param name="feedUrl">The url of the feed</param>
/// <param name="posts">The feed entries.</param>
public static string BuildRss(string feedAuthor, string feedTitle, string feedDescription, string feedUrl, IList<IPublishable> posts)
{
return BuildAsXml(feedAuthor, feedTitle, feedDescription, feedUrl, posts, (feed) => new Rss20FeedFormatter(feed));
}
/// <summary>
/// Build the feed using the IPublishable items.
/// </summary>
/// <param name="feedAuthor">The author of the feed.</param>
/// <param name="feedTitle">The title of the feed</param>
/// <param name="feedDescription">The description of the feed.</param>
/// <param name="feedUrl">The url of the feed</param>
/// <param name="posts">The feed entries.</param>
public static string BuildAtom(string feedAuthor, string feedTitle, string feedDescription, string feedUrl, IList<IPublishable> posts)
{
return BuildAsXml(feedAuthor, feedTitle, feedDescription, feedUrl, posts, (feed) => new Atom10FeedFormatter(feed));
}
/// <summary>
/// Build the feed using the IPublishable items.
/// </summary>
/// <param name="feedAuthor">The author of the feed.</param>
/// <param name="feedTitle">The title of the feed</param>
/// <param name="feedDescription">The description of the feed.</param>
/// <param name="feedUrl">The url of the feed</param>
/// <param name="posts">The feed entries.</param>
/// <param name="writer">The writer to write the feed to</param>
public static void BuildRss(string feedAuthor, string feedTitle, string feedDescription, string feedUrl, IList<IPublishable> posts, TextWriter writer)
{
BuildAsXml(feedAuthor, feedTitle, feedDescription, feedUrl, posts, writer, (feed) => new Rss20FeedFormatter(feed));
}
/// <summary>
后面还有 103 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
