Rss20ItemFormatter.WriteTo(XmlWriter) メソッド

定義

Rss20FeedFormatter に関連付けられたSyndicationItem を、指定された XmlWriter に書き込みます。Writes the SyndicationItem associated with the Rss20FeedFormatter to the specified XmlWriter.

public:
 override void WriteTo(System::Xml::XmlWriter ^ writer);
public override void WriteTo (System.Xml.XmlWriter writer);
override this.WriteTo : System.Xml.XmlWriter -> unit
Public Overrides Sub WriteTo (writer As XmlWriter)

パラメーター

writer
XmlWriter

書き込み先の XmlWriterThe XmlWriter to write to.

次のコードは、配信項目の作成方法と Rss20ItemFormatter を使用してフィードを XmlWriter に書き込む方法を示します。The following code shows how to create a syndication feed and use a Rss20ItemFormatter to write the item to an XmlWriter.

SyndicationItem item = new SyndicationItem("Test Item", "This is the content for Test Item", new Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now);

XmlWriter rssWriter = XmlWriter.Create("RSS.xml");
Rss20ItemFormatter rssFormatter = new Rss20ItemFormatter(item);

rssFormatter.WriteTo(rssWriter);
rssWriter.Close();

適用対象