Rss20ItemFormatter<TSyndicationItem> コンストラクター

定義

Rss20ItemFormatter<TSyndicationItem> クラスの新しいインスタンスを作成します。Creates a new instance of the Rss20ItemFormatter<TSyndicationItem> class.

オーバーロード

Rss20ItemFormatter<TSyndicationItem>()

Rss20ItemFormatter<TSyndicationItem> クラスの新しいインスタンスを作成します。Creates a new instance of the Rss20ItemFormatter<TSyndicationItem> class.

Rss20ItemFormatter<TSyndicationItem>(TSyndicationItem)

指定された Rss20ItemFormatter<TSyndicationItem> 派生インスタンスを使用して SyndicationItem クラスの新しいインスタンスを作成します。Creates a new instance of the Rss20ItemFormatter<TSyndicationItem> class with the specified SyndicationItem derived instance.

Rss20ItemFormatter<TSyndicationItem>(TSyndicationItem, Boolean)

指定された Rss20ItemFormatter<TSyndicationItem> 派生インスタンスを使用して SyndicationItem クラスの新しいインスタンスを作成します。Creates a new instance of the Rss20ItemFormatter<TSyndicationItem> class with the specified SyndicationItem derived instance.

Rss20ItemFormatter<TSyndicationItem>()

Rss20ItemFormatter<TSyndicationItem> クラスの新しいインスタンスを作成します。Creates a new instance of the Rss20ItemFormatter<TSyndicationItem> class.

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

Rss20ItemFormatter<TSyndicationItem>(TSyndicationItem)

指定された Rss20ItemFormatter<TSyndicationItem> 派生インスタンスを使用して SyndicationItem クラスの新しいインスタンスを作成します。Creates a new instance of the Rss20ItemFormatter<TSyndicationItem> class with the specified SyndicationItem derived instance.

public:
 Rss20ItemFormatter(TSyndicationItem itemToWrite);
public Rss20ItemFormatter (TSyndicationItem itemToWrite);
new System.ServiceModel.Syndication.Rss20ItemFormatter<'SyndicationItem (requires 'SyndicationItem :> System.ServiceModel.Syndication.SyndicationItem and 'SyndicationItem : (new : unit -> 'SyndicationItem))> : 'SyndicationItem -> System.ServiceModel.Syndication.Rss20ItemFormatter<'SyndicationItem (requires 'SyndicationItem :> System.ServiceModel.Syndication.SyndicationItem and 'SyndicationItem : (new : unit -> 'SyndicationItem))>
Public Sub New (itemToWrite As TSyndicationItem)

パラメーター

itemToWrite
TSyndicationItem

シリアル化する SyndicationItemThe SyndicationItem to serialize.

次の例は、このコンストラクターを呼び出す方法を示しています。The following example shows how to call this constructor.

MySyndicationItem item = new MySyndicationItem("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<MySyndicationItem> formatter = new Rss20ItemFormatter<MySyndicationItem>(item);
Dim item As MySyndicationItem = New MySyndicationItem("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(Of MySyndicationItem) = New Rss20ItemFormatter(Of MySyndicationItem)(item)

Rss20ItemFormatter<TSyndicationItem>(TSyndicationItem, Boolean)

指定された Rss20ItemFormatter<TSyndicationItem> 派生インスタンスを使用して SyndicationItem クラスの新しいインスタンスを作成します。Creates a new instance of the Rss20ItemFormatter<TSyndicationItem> class with the specified SyndicationItem derived instance.

public:
 Rss20ItemFormatter(TSyndicationItem itemToWrite, bool serializeExtensionsAsAtom);
public Rss20ItemFormatter (TSyndicationItem itemToWrite, bool serializeExtensionsAsAtom);
new System.ServiceModel.Syndication.Rss20ItemFormatter<'SyndicationItem (requires 'SyndicationItem :> System.ServiceModel.Syndication.SyndicationItem and 'SyndicationItem : (new : unit -> 'SyndicationItem))> : 'SyndicationItem * bool -> System.ServiceModel.Syndication.Rss20ItemFormatter<'SyndicationItem (requires 'SyndicationItem :> System.ServiceModel.Syndication.SyndicationItem and 'SyndicationItem : (new : unit -> 'SyndicationItem))>
Public Sub New (itemToWrite As TSyndicationItem, serializeExtensionsAsAtom As Boolean)

パラメーター

itemToWrite
TSyndicationItem

シリアル化する SyndicationItemThe SyndicationItem to serialize.

serializeExtensionsAsAtom
Boolean

Atom 1.0 仕様では定義されているが RSS 2.0 仕様では定義されていない要素をシリアル化するかどうかを指定する値。A value that specifies whether to serialize elements that are defined in the Atom 1.0 specification but not in the RSS 2.0 specification. 既定値は true です。The default value is true.

次の例は、このコンストラクターを呼び出す方法を示しています。The following example shows how to call this constructor.

MySyndicationItem item = new MySyndicationItem("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<MySyndicationItem> formatter = new Rss20ItemFormatter<MySyndicationItem>(item, true);
Dim item As MySyndicationItem = New MySyndicationItem("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(Of MySyndicationItem) = New Rss20ItemFormatter(Of MySyndicationItem)(item, True)

注釈

serializeExtensionsAsAtom パラメーターが true{3}の場合、Atom 1.0 仕様では定義されているが RSS 2.0 仕様では定義されていないすべての要素は、Atom 1.0 名前空間でシリアル化されます。If the serializeExtensionsAsAtom parameter is true, all elements defined in the Atom 1.0 specification that are not defined in the RSS 2.0 specification are serialized with the Atom 1.0 namespace.

適用対象