Rss20FeedFormatter<TSyndicationFeed> 생성자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
Rss20FeedFormatter<TSyndicationFeed> 클래스의 새 인스턴스를 만듭니다.
오버로드
Rss20FeedFormatter<TSyndicationFeed>() |
Rss20FeedFormatter<TSyndicationFeed> 클래스의 새 인스턴스를 만듭니다. |
Rss20FeedFormatter<TSyndicationFeed>(TSyndicationFeed) |
지정된 Rss20FeedFormatter<TSyndicationFeed> 파생 인스턴스를 사용하여 SyndicationFeed 클래스의 새 인스턴스를 만듭니다. |
Rss20FeedFormatter<TSyndicationFeed>(TSyndicationFeed, Boolean) |
지정된 Rss20FeedFormatter<TSyndicationFeed> 파생 인스턴스를 사용하여 SyndicationFeed 클래스의 새 인스턴스를 만듭니다. |
Rss20FeedFormatter<TSyndicationFeed>()
Rss20FeedFormatter<TSyndicationFeed> 클래스의 새 인스턴스를 만듭니다.
public:
Rss20FeedFormatter();
public Rss20FeedFormatter ();
Public Sub New ()
적용 대상
Rss20FeedFormatter<TSyndicationFeed>(TSyndicationFeed)
지정된 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
serialize할 피드입니다.
예제
다음 예제에서는 이 생성자를 호출하는 방법을 보여 줍니다.
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<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
serialize할 피드입니다.
- serializeExtensionsAsAtom
- Boolean
Atom 1.0 사양에서 정의되지만 RSS 2.0 사양에서는 정의되지 않는 요소를 serialize할 것인지 여부를 지정하는 값입니다. 기본값은 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)
설명
serializeExtensionsAsAtom
매개 변수인 true
경우 RSS 2.0 사양에 정의되지 않은 Atom 1.0 사양에 정의된 모든 요소는 Atom 1.0 네임스페이스를 사용하여 serialize됩니다.