SyndicationItem.GetAtom10Formatter 方法

定义

获取一个 Atom10FeedFormatter 实例。

public:
 System::ServiceModel::Syndication::Atom10ItemFormatter ^ GetAtom10Formatter();
public System.ServiceModel.Syndication.Atom10ItemFormatter GetAtom10Formatter ();
member this.GetAtom10Formatter : unit -> System.ServiceModel.Syndication.Atom10ItemFormatter
Public Function GetAtom10Formatter () As Atom10ItemFormatter

返回

一个 Atom10FeedFormatter 实例。

示例

下面的代码演示如何将 Atom 1.0 格式的联合项写入 XML 文件。

SyndicationItem item = new SyndicationItem("Item Title", "Item Content", new Uri("http://Item/Alternate/Link"), "itemID", DateTimeOffset.Now);
Atom10ItemFormatter atomFormatter = item.GetAtom10Formatter();
XmlWriter writer = XmlWriter.Create("output.xml");
atomFormatter.WriteTo(writer);
writer.Close();
Dim item As New SyndicationItem("Item Title", "Item Content", New Uri("http:' Item/Alternate/Link"), "itemID", DateTimeOffset.Now)
Dim atomFormatter As Atom10ItemFormatter = item.GetAtom10Formatter()
Dim writer As XmlWriter = XmlWriter.Create("output.xml")
atomFormatter.WriteTo(writer)
writer.Close()

适用于