更新 : 2007 年 11 月
名前空間 :
System.ServiceModel.Syndication
アセンブリ :
System.ServiceModel.Web (System.ServiceModel.Web.dll 内)
Public Class Rss20FeedFormatter _
Inherits SyndicationFeedFormatter _
Implements IXmlSerializable
Dim instance As Rss20FeedFormatter
public class Rss20FeedFormatter : SyndicationFeedFormatter,
IXmlSerializable
public ref class Rss20FeedFormatter : public SyndicationFeedFormatter,
IXmlSerializable
public class Rss20FeedFormatter extends SyndicationFeedFormatter implements IXmlSerializable
public class Rss20FeedFormatter extends SyndicationFeedFormatter implements IXmlSerializable
このクラスを使用して、SyndicationFeed のインスタンスをシリアル化し、RSS 2.0 フィードを表す XML ドキュメントから SyndicationFeed のインスタンスを作成します。SyndicationFeed からクラスを派生させ、それをシリアル化する場合、Rss20FeedFormatter<(Of <(TSyndicationFeed>)>) フォーマッタを使用します。
SyndicationFeed を作成し、それを RSS 2.0 にシリアル化する方法を次のコードに示します。
Dim feed As SyndicationFeed = New SyndicationFeed("Test Feed", "This is a test feed", New Uri("http://Contoso/testfeed"), "TestFeedID", DateTime.Now)
Dim item As SyndicationItem = New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now)
Dim items As List(Of SyndicationItem) = New List(Of SyndicationItem)()
items.Add(item)
feed.Items = items
Dim rssWriter As XmlWriter = XmlWriter.Create("RSS.xml")
Dim rssFormatter As Rss20FeedFormatter = New Rss20FeedFormatter(feed)
rssFormatter.WriteTo(rssWriter)
rssWriter.Close()
SyndicationFeed feed = new SyndicationFeed("Test Feed", "This is a test feed", new Uri("http://Contoso/testfeed"), "TestFeedID", DateTime.Now);
SyndicationItem item = new SyndicationItem("Test Item", "This is the content for Test Item", new Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now);
List<SyndicationItem> items = new List<SyndicationItem>();
items.Add(item);
feed.Items = items;
XmlWriter rssWriter = XmlWriter.Create("RSS.xml");
Rss20FeedFormatter rssFormatter = new Rss20FeedFormatter(feed);
rssFormatter.WriteTo(rssWriter);
rssWriter.Close();
System..::.Object
System.ServiceModel.Syndication..::.SyndicationFeedFormatter
System.ServiceModel.Syndication..::.Rss20FeedFormatter
System.ServiceModel.Syndication..::.Rss20FeedFormatter<(Of <(TSyndicationFeed>)>)
この型のすべてのパブリック static (Visual Basic では Shared) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
.NET Framework
サポート対象 : 3.5
参照