Lenguaje

Rss20ItemFormatter.WriteTo(XmlWriter) Método

Definición

Escribe el SyndicationItem objeto asociado al Rss20FeedFormatter objeto en el 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

en el XmlWriter que se va a escribir.

Ejemplos

En el código siguiente se muestra cómo crear una fuente de distribución y usar para Rss20ItemFormatter escribir el elemento en un 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();

Se aplica a