Rss20FeedFormatter<TSyndicationFeed> コンストラクター

定義

Rss20FeedFormatter<TSyndicationFeed> クラスの新しいインスタンスを作成します。

オーバーロード

Rss20FeedFormatter<TSyndicationFeed>()

Rss20FeedFormatter<TSyndicationFeed> クラスの新しいインスタンスを作成します。

Rss20FeedFormatter<TSyndicationFeed>(TSyndicationFeed)

指定された Rss20FeedFormatter<TSyndicationFeed> 派生インスタンスを使用して SyndicationFeed クラスの新しいインスタンスを作成します。

Rss20FeedFormatter<TSyndicationFeed>(TSyndicationFeed, Boolean)

指定された Rss20FeedFormatter<TSyndicationFeed> 派生インスタンスを使用して SyndicationFeed クラスの新しいインスタンスを作成します。

Rss20FeedFormatter<TSyndicationFeed>()

ソース:
Rss20FeedFormatter.cs
ソース:
Rss20FeedFormatter.cs
ソース:
Rss20FeedFormatter.cs
ソース:
Rss20FeedFormatter.cs

Rss20FeedFormatter<TSyndicationFeed> クラスの新しいインスタンスを作成します。

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

適用対象

Rss20FeedFormatter<TSyndicationFeed>(TSyndicationFeed)

ソース:
Rss20FeedFormatter.cs
ソース:
Rss20FeedFormatter.cs
ソース:
Rss20FeedFormatter.cs
ソース:
Rss20FeedFormatter.cs

指定された Rss20FeedFormatter<TSyndicationFeed> 派生インスタンスを使用して SyndicationFeed クラスの新しいインスタンスを作成します。

public:
 Rss20FeedFormatter(TSyndicationFeed feedToWrite);
public Rss20FeedFormatter (TSyndicationFeed feedToWrite);
new System.ServiceModel.Syndication.Rss20FeedFormatter<'SyndicationFeed (requires 'SyndicationFeed :> System.ServiceModel.Syndication.SyndicationFeed and 'SyndicationFeed : (new : unit -> 'SyndicationFeed))> : 'SyndicationFeed -> System.ServiceModel.Syndication.Rss20FeedFormatter<'SyndicationFeed (requires 'SyndicationFeed :> System.ServiceModel.Syndication.SyndicationFeed and 'SyndicationFeed : (new : unit -> 'SyndicationFeed))>
Public Sub New (feedToWrite As TSyndicationFeed)

パラメーター

feedToWrite
TSyndicationFeed

シリアル化するフィード。

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

           MySyndicationFeed feed = new MySyndicationFeed("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://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 = feed;
           item.Summary = new TextSyndicationContent("This the item summary");

       List<SyndicationItem> items = new List<SyndicationItem>();
       items.Add(item);
           feed.Items = items;

           XmlWriter rssWriter = XmlWriter.Create("Rss.xml");
           Rss20FeedFormatter<MySyndicationFeed> rssFormatter = new Rss20FeedFormatter<MySyndicationFeed>(feed);
Dim feed As MySyndicationFeed = New MySyndicationFeed("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://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 = feed
item.Summary = New TextSyndicationContent("This the item summary")

Dim items As List(Of SyndicationItem) = New List(Of SyndicationItem)()
items.Add(item)
feed.Items = items

Dim rssWriter As XmlWriter = XmlWriter.Create("Rss.xml")
Dim rssFormatter As Rss20FeedFormatter(Of MySyndicationFeed) = New Rss20FeedFormatter(Of MySyndicationFeed)(feed)

適用対象

Rss20FeedFormatter<TSyndicationFeed>(TSyndicationFeed, Boolean)

ソース:
Rss20FeedFormatter.cs
ソース:
Rss20FeedFormatter.cs
ソース:
Rss20FeedFormatter.cs
ソース:
Rss20FeedFormatter.cs

指定された Rss20FeedFormatter<TSyndicationFeed> 派生インスタンスを使用して SyndicationFeed クラスの新しいインスタンスを作成します。

public:
 Rss20FeedFormatter(TSyndicationFeed feedToWrite, bool serializeExtensionsAsAtom);
public Rss20FeedFormatter (TSyndicationFeed feedToWrite, bool serializeExtensionsAsAtom);
new System.ServiceModel.Syndication.Rss20FeedFormatter<'SyndicationFeed (requires 'SyndicationFeed :> System.ServiceModel.Syndication.SyndicationFeed and 'SyndicationFeed : (new : unit -> 'SyndicationFeed))> : 'SyndicationFeed * bool -> System.ServiceModel.Syndication.Rss20FeedFormatter<'SyndicationFeed (requires 'SyndicationFeed :> System.ServiceModel.Syndication.SyndicationFeed and 'SyndicationFeed : (new : unit -> 'SyndicationFeed))>
Public Sub New (feedToWrite As TSyndicationFeed, serializeExtensionsAsAtom As Boolean)

パラメーター

feedToWrite
TSyndicationFeed

シリアル化するフィード。

serializeExtensionsAsAtom
Boolean

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

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

           MySyndicationFeed feed = new MySyndicationFeed("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://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 = feed;
           item.Summary = new TextSyndicationContent("This the item summary");

       List<SyndicationItem> items = new List<SyndicationItem>();
       items.Add(item);
           feed.Items = items;

           XmlWriter rssWriter = XmlWriter.Create("Rss.xml");
           Rss20FeedFormatter<MySyndicationFeed> rssFormatter = new Rss20FeedFormatter<MySyndicationFeed>(feed, true);
Dim feed As MySyndicationFeed = New MySyndicationFeed("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://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 = feed
item.Summary = New TextSyndicationContent("This the item summary")

Dim items As List(Of SyndicationItem) = New List(Of SyndicationItem)()
items.Add(item)
feed.Items = items

Dim rssWriter As XmlWriter = XmlWriter.Create("Rss.xml")
Dim rssFormatter As Rss20FeedFormatter(Of MySyndicationFeed) = New Rss20FeedFormatter(Of MySyndicationFeed)(feed, True)

注釈

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

適用対象