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

serialize할 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

serialize할 SyndicationItem입니다.

serializeExtensionsAsAtom
Boolean

Atom 1.0 사양에서 정의되지만 RSS 2.0 사양에서는 정의되지 않는 요소를 serialize할 것인지 여부를 지정하는 값입니다. 기본값은 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)

설명

serializeExtensionsAsAtom 매개 변수인 true경우 RSS 2.0 사양에 정의되지 않은 Atom 1.0 사양에 정의된 모든 요소는 Atom 1.0 네임스페이스를 사용하여 serialize됩니다.

적용 대상