Rss20ItemFormatter.WriteTo(XmlWriter) Método

Definição

Escreve o SyndicationItem associado ao Rss20FeedFormatter especificado 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)

Parâmetros

writer
XmlWriter

O XmlWriter para escrever.

Exemplos

O código seguinte mostra como criar um feed de sindicância e usar a Rss20ItemFormatter para escrever o item num 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