Rss20ItemFormatter.WriteTo(XmlWriter) Método

Definição

Grava o SyndicationItem associado ao Rss20FeedFormatter no XmlWriter especificado.

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)

Parâmetros

writer
XmlWriter

O XmlWriter no qual ocorrerá a gravação.

Exemplos

O código a seguir mostra como criar um feed de sindicalização e usar um Rss20ItemFormatter para gravar o item em um 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();

Aplica-se a