Rss20ItemFormatter コンストラクター

定義

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

オーバーロード

Rss20ItemFormatter()

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

Rss20ItemFormatter(SyndicationItem)

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

Rss20ItemFormatter(Type)

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

Rss20ItemFormatter(SyndicationItem, Boolean)

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

Rss20ItemFormatter()

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

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

適用対象

Rss20ItemFormatter(SyndicationItem)

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

public:
 Rss20ItemFormatter(System::ServiceModel::Syndication::SyndicationItem ^ itemToWrite);
public Rss20ItemFormatter (System.ServiceModel.Syndication.SyndicationItem itemToWrite);
new System.ServiceModel.Syndication.Rss20ItemFormatter : System.ServiceModel.Syndication.SyndicationItem -> System.ServiceModel.Syndication.Rss20ItemFormatter
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://Contoso/ItemOne"), "TestItemID", DateTime.Now);

item.Links.Add(new SyndicationLink(new Uri("http://Contoso"), "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 rssWriter = XmlWriter.Create("RssItem.xml");
Rss20ItemFormatter formatter = new Rss20ItemFormatter(item);
Dim item As SyndicationItem = New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now)

item.Links.Add(New SyndicationLink(New Uri("http://Contoso"), "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 rssWriter As XmlWriter = XmlWriter.Create("RssItem.xml")
Dim formatter As Rss20ItemFormatter = New Rss20ItemFormatter(item)

適用対象

Rss20ItemFormatter(Type)

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

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

パラメーター

itemTypeToCreate
Type

SyndicationItem に関連付ける Rss20ItemFormatter から派生したインスタンス。

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

Rss20ItemFormatter myItemRssFormatter = new Rss20ItemFormatter(typeof(MySyndicationItem));
XmlReader rssReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Items");
myItemRssFormatter.ReadFrom(rssReader);
rssReader.Close();

注釈

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

適用対象

Rss20ItemFormatter(SyndicationItem, Boolean)

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

public:
 Rss20ItemFormatter(System::ServiceModel::Syndication::SyndicationItem ^ itemToWrite, bool serializeExtensionsAsAtom);
public Rss20ItemFormatter (System.ServiceModel.Syndication.SyndicationItem itemToWrite, bool serializeExtensionsAsAtom);
new System.ServiceModel.Syndication.Rss20ItemFormatter : System.ServiceModel.Syndication.SyndicationItem * bool -> System.ServiceModel.Syndication.Rss20ItemFormatter
Public Sub New (itemToWrite As SyndicationItem, serializeExtensionsAsAtom As Boolean)

パラメーター

itemToWrite
SyndicationItem

シリアル化する SyndicationItem

serializeExtensionsAsAtom
Boolean

Atom 1.0 仕様では定義されているが RSS 2.0 仕様では定義されていない要素をシリアル化するかどうかを指定する値。 既定値は true です。

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

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

item.Links.Add(new SyndicationLink(new Uri("http://Contoso"), "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 rssWriter = XmlWriter.Create("RssItem.xml");
Rss20ItemFormatter formatter = new Rss20ItemFormatter(item, true);
Dim item As SyndicationItem = New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now)

item.Links.Add(New SyndicationLink(New Uri("http://Contoso"), "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 rssWriter As XmlWriter = XmlWriter.Create("RssItem.xml")
Dim formatter As Rss20ItemFormatter = New Rss20ItemFormatter(item, True)

注釈

パラメーターが の場合、Atom 1.0 仕様では定義されているが RSS 2.0 仕様では定義されていないすべての要素は、Atom 1.0 名前空間でシリアル化されます。

適用対象