Partager via


Atom10ItemFormatter.WriteTo(XmlWriter) Méthode

Définition

Écrit le SyndicationItem associé au Atom10ItemFormatter dans l’objet XmlWriter spécifié.

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 dans lequel écrire.

Exemples

L'exemple de code suivant illustre l'appel à WriteTo.

SyndicationItem item = new SyndicationItem("Test Item", "This is the content for Test Item", new Uri("http://localhost/ItemOne"), "TestItemID", DateTime.Now);

Atom10ItemFormatter atomItemFormatter = new Atom10ItemFormatter(item);
XmlWriter atomWriter = XmlWriter.Create("Atom.xml");
atomItemFormatter.WriteTo(atomWriter);
atomWriter.Close();
Dim item As New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http://localhost/ItemOne"), "TestItemID", DateTime.Now)

Dim atomItemFormatter As New Atom10ItemFormatter(item)
Dim atomWriter As XmlWriter = XmlWriter.Create("Atom.xml")
atomItemFormatter.WriteTo(atomWriter)
atomWriter.Close()

S’applique à