Rss20ItemFormatter.WriteTo(XmlWriter) Méthode

Définition

Écrit l’associé SyndicationItemRss20FeedFormatter au fichier spécifié 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)

Paramètres

writer
XmlWriter

XmlWriter À écrire.

Exemples

Le code suivant montre comment créer un flux de syndication et utiliser un Rss20ItemFormatter pour écrire l’élément dans 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();

S’applique à