Rss20ItemFormatter 클래스

정의

SyndicationItem 인스턴스를 RSS 2.0 형식으로 또는 그 반대로 serialize하는 클래스입니다.

public ref class Rss20ItemFormatter : System::ServiceModel::Syndication::SyndicationItemFormatter, System::Xml::Serialization::IXmlSerializable
public class Rss20ItemFormatter : System.ServiceModel.Syndication.SyndicationItemFormatter, System.Xml.Serialization.IXmlSerializable
type Rss20ItemFormatter = class
    inherit SyndicationItemFormatter
    interface IXmlSerializable
Public Class Rss20ItemFormatter
Inherits SyndicationItemFormatter
Implements IXmlSerializable
상속
Rss20ItemFormatter
파생
구현

예제

다음 코드에서는 인스턴스를 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);
formatter.WriteTo(rssWriter);
rssWriter.Close();
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)
formatter.WriteTo(rssWriter)
rssWriter.Close()

설명

이 클래스를 사용하여 인스턴스를 SyndicationItem 직렬화하고 RSS 2.0 항목을 나타내는 XML 문서에서 인스턴스 SyndicationItem 를 만듭니다. 클래스 SyndicationItem 를 파생하고 직렬화하려는 경우 포맷터를 사용합니다 Rss20ItemFormatter<TSyndicationItem> .

생성자

Rss20ItemFormatter()

Rss20ItemFormatter 클래스의 새 인스턴스를 만듭니다.

Rss20ItemFormatter(SyndicationItem)

Rss20ItemFormatter 클래스의 새 인스턴스를 만듭니다.

Rss20ItemFormatter(SyndicationItem, Boolean)

Rss20ItemFormatter 클래스의 새 인스턴스를 만듭니다.

Rss20ItemFormatter(Type)

Rss20ItemFormatter 클래스의 새 인스턴스를 만듭니다.

속성

Item

포맷터와 연결된 SyndicationItem 를 가져옵니다.

(다음에서 상속됨 SyndicationItemFormatter)
ItemType

Rss20ItemFormatter와 연결된 배포 항목의 형식을 가져옵니다.

PreserveAttributeExtensions

serialization 중에 특성 확장을 유지할지 여부를 지정하는 값을 가져오거나 설정합니다.

PreserveElementExtensions

serialization 중에 요소 확장을 유지할지 여부를 지정하는 값을 가져오거나 설정합니다.

SerializeExtensionsAsAtom

Atom 1.0 네임스페이스 내부에서 확장을 직렬화할지 여부를 지정하는 값을 가져오거나 설정합니다.

Version

포맷터에서 사용되는 배포 버전을 가져옵니다.

메서드

CanRead(XmlReader)

지정된 XmlReader가 유효한 RSS 2.0 배포 항목을 포함하는지 여부를 확인합니다.

CreateItemInstance()

SyndicationItem 인스턴스를 만듭니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ReadFrom(XmlReader)

지정된 XmlReader 인스턴스로부터 RSS 2.0 배포 항목을 읽습니다.

SetItem(SyndicationItem)

SyndicationItem 인스턴스를 SyndicationItemFormatter와 연결합니다.

(다음에서 상속됨 SyndicationItemFormatter)
ToString()

SyndicationItemFormatter 인스턴스의 문자열 표현을 가져옵니다.

(다음에서 상속됨 SyndicationItemFormatter)
WriteElementExtensions(XmlWriter, SyndicationCategory, String)

SyndicationCategory 인스턴스의 요소 확장을 지정된 배포 버전의 XmlWriter 에 씁니다.

(다음에서 상속됨 SyndicationItemFormatter)
WriteElementExtensions(XmlWriter, SyndicationLink, String)

SyndicationLink 인스턴스의 요소 확장을 지정된 배포 버전의 XmlWriter 에 씁니다.

(다음에서 상속됨 SyndicationItemFormatter)
WriteElementExtensions(XmlWriter, SyndicationPerson, String)

SyndicationPerson 인스턴스의 요소 확장을 지정된 배포 버전의 XmlWriter 에 씁니다.

(다음에서 상속됨 SyndicationItemFormatter)
WriteTo(XmlWriter)

SyndicationItem 와 연결된 Rss20FeedFormatter 를 지정된 XmlWriter에 씁니다.

명시적 인터페이스 구현

IXmlSerializable.GetSchema()

GetSchema() 메서드를 구현합니다.

IXmlSerializable.ReadXml(XmlReader)

ReadXml(XmlReader) 메서드를 구현합니다.

IXmlSerializable.WriteXml(XmlWriter)

WriteXml(XmlWriter) 메서드를 구현합니다.

적용 대상