Rss20ItemFormatter.WriteTo(XmlWriter) Metoda

Definicja

Zapisuje element SyndicationItem skojarzony z elementem Rss20FeedFormatter do określonego XmlWriterelementu .

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)

Parametry

writer
XmlWriter

Element XmlWriter do zapisu.

Przykłady

Poniższy kod pokazuje, jak utworzyć źródło danych syndykacji i użyć elementu Rss20ItemFormatter do zapisania elementu w elemencie 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();

Dotyczy