Atom10ItemFormatter コンストラクター

定義

Atom10ItemFormatter クラスの新しいインスタンスを作成します。

オーバーロード

Atom10ItemFormatter()

Atom10ItemFormatter クラスの新しいインスタンスを作成します。

Atom10ItemFormatter(SyndicationItem)

指定された Atom10ItemFormatterSyndicationItem クラスの新しいインスタンスを作成します。

Atom10ItemFormatter(Type)

Atom10ItemFormatter クラスの新しいインスタンスを初期化します。

Atom10ItemFormatter()

ソース:
Atom10ItemFormatter.cs
ソース:
Atom10ItemFormatter.cs
ソース:
Atom10ItemFormatter.cs
ソース:
Atom10ItemFormatter.cs

Atom10ItemFormatter クラスの新しいインスタンスを作成します。

public:
 Atom10ItemFormatter();
public Atom10ItemFormatter ();
Public Sub New ()

適用対象

Atom10ItemFormatter(SyndicationItem)

ソース:
Atom10ItemFormatter.cs
ソース:
Atom10ItemFormatter.cs
ソース:
Atom10ItemFormatter.cs
ソース:
Atom10ItemFormatter.cs

指定された Atom10ItemFormatterSyndicationItem クラスの新しいインスタンスを作成します。

public:
 Atom10ItemFormatter(System::ServiceModel::Syndication::SyndicationItem ^ itemToWrite);
public Atom10ItemFormatter (System.ServiceModel.Syndication.SyndicationItem itemToWrite);
new System.ServiceModel.Syndication.Atom10ItemFormatter : System.ServiceModel.Syndication.SyndicationItem -> System.ServiceModel.Syndication.Atom10ItemFormatter
Public Sub New (itemToWrite As SyndicationItem)

パラメーター

itemToWrite
SyndicationItem

シリアル化する SyndicationItem

次の例は、このコンストラクターを呼び出す方法を示しています。

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

item.Links.Add(new SyndicationLink(new Uri("http://someuri"), "alternate", "MyItemLink", "text/html", 100));
item.PublishDate = new DateTime(1968, 2, 23);
item.LastUpdatedTime = DateTime.Today;
item.SourceFeed = new SyndicationFeed();
item.Summary = new TextSyndicationContent("This the item summary");

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

item.Links.Add(New SyndicationLink(New Uri("http:'someuri"), "alternate", "MyItemLink", "text/html", 100))
item.PublishDate = New DateTime(1968, 2, 23)
item.LastUpdatedTime = DateTime.Today
item.SourceFeed = New SyndicationFeed()
item.Summary = New TextSyndicationContent("This the item summary")

Dim atomWriter As XmlWriter = XmlWriter.Create("AtomItem.xml")
Dim formatter As Atom10ItemFormatter = New Atom10ItemFormatter(item)

適用対象

Atom10ItemFormatter(Type)

ソース:
Atom10ItemFormatter.cs
ソース:
Atom10ItemFormatter.cs
ソース:
Atom10ItemFormatter.cs
ソース:
Atom10ItemFormatter.cs

Atom10ItemFormatter クラスの新しいインスタンスを初期化します。

public:
 Atom10ItemFormatter(Type ^ itemTypeToCreate);
public Atom10ItemFormatter (Type itemTypeToCreate);
new System.ServiceModel.Syndication.Atom10ItemFormatter : Type -> System.ServiceModel.Syndication.Atom10ItemFormatter
Public Sub New (itemTypeToCreate As Type)

パラメーター

itemTypeToCreate
Type

SyndicationItemに関連付けるRss20ItemFormatter派生インスタンス。

次のコードは、このコンストラクターを使用する方法を示しています。

Atom10ItemFormatter myItemAtomFormatter = new Atom10ItemFormatter(typeof(MySyndicationItem));
XmlReader atomReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Items");
myItemAtomFormatter.ReadFrom(atomReader);
atomReader.Close();
Dim myItemAtomFormatter As New Atom10ItemFormatter(GetType(MySyndicationItem))
Dim atomReader As XmlReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Items")
myItemAtomFormatter.ReadFrom(atomReader)
atomReader.Close()

注釈

このコンストラクターを使用して、配信項目が読み込まれたときにインスタンスを作成する SyndicationItem から派生したクラスを指定します。

適用対象