更新 : 2007 年 11 月
名前空間 :
System.ServiceModel.Syndication
アセンブリ :
System.ServiceModel.Web (System.ServiceModel.Web.dll 内)
Public Class Atom10FeedFormatter _
Inherits SyndicationFeedFormatter _
Implements IXmlSerializable
Dim instance As Atom10FeedFormatter
public class Atom10FeedFormatter : SyndicationFeedFormatter,
IXmlSerializable
public ref class Atom10FeedFormatter : public SyndicationFeedFormatter,
IXmlSerializable
public class Atom10FeedFormatter extends SyndicationFeedFormatter implements IXmlSerializable
public class Atom10FeedFormatter extends SyndicationFeedFormatter implements IXmlSerializable
このクラスを使用して、SyndicationFeed のインスタンスをシリアル化し、Atom 1.0 フィードを表す XML ドキュメントから SyndicationFeed のインスタンスを作成します。SyndicationFeed からクラスを派生させ、それをシリアル化する場合、Atom10FeedFormatter<(Of <(TSyndicationFeed>)>) フォーマッタを使用します。
メモ : |
|---|
Atom 1.0 仕様では、date コンストラクトで小数秒を指定できます。シリアル化および逆シリアル化する場合、WCF の実装では小数秒は無視されます。 |
SyndicationFeed を作成し、それを Atom 1.0 にシリアル化する方法を次のコードに示します。
Dim feed As SyndicationFeed = New SyndicationFeed("Test Feed", "This is a test feed", New Uri("http:'Contoso/testfeed"), "TestFeedID", DateTime.Now)
Dim item As SyndicationItem = New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http:'localhost/ItemOne"), "TestItemID", DateTime.Now)
Dim items As List(Of SyndicationItem) = New List(Of SyndicationItem)
items.Add(item)
feed.Items = items
Dim atomWriter As XmlWriter = XmlWriter.Create("Atom.xml")
Dim atomFormatter As Atom10FeedFormatter = New Atom10FeedFormatter(feed)
atomFormatter.WriteTo(atomWriter)
atomWriter.Close()
SyndicationFeed feed = new SyndicationFeed("Test Feed", "This is a test feed", new Uri("http://Contoso/testfeed"), "TestFeedID", DateTime.Now);
SyndicationItem item = new SyndicationItem("Test Item", "This is the content for Test Item", new Uri("http://localhost/ItemOne"), "TestItemID", DateTime.Now);
List<SyndicationItem> items = new List<SyndicationItem>();
items.Add(item);
feed.Items = items;
XmlWriter atomWriter = XmlWriter.Create("Atom.xml");
Atom10FeedFormatter atomFormatter = new Atom10FeedFormatter(feed);
atomFormatter.WriteTo(atomWriter);
atomWriter.Close();
System..::.Object
System.ServiceModel.Syndication..::.SyndicationFeedFormatter
System.ServiceModel.Syndication..::.Atom10FeedFormatter
System.ServiceModel.Syndication..::.Atom10FeedFormatter<(Of <(TSyndicationFeed>)>)
この型のすべてのパブリック static (Visual Basic では Shared) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
.NET Framework
サポート対象 : 3.5
参照