Rss20ItemFormatter Rss20ItemFormatter Rss20ItemFormatter Rss20ItemFormatter Class

Definição

Uma classe que serializa uma instância SyndicationItem para e do formato RSS 2.0.A class that serializes a SyndicationItem instance to and from RSS 2.0 format.

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
Herança
Derivado
Implementações

Exemplos

O código a seguir mostra como criar uma SyndicationItem instância e serializá-la.The following code shows how to create a SyndicationItem instance and serialize it.

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()

Comentários

Use essa classe para serializar instâncias SyndicationItem do e para criar uma instância SyndicationItem do de um documento XML que representa um item RSS 2,0.Use this class to serialize instances of SyndicationItem and to create an instance of SyndicationItem from an XML document that represents an RSS 2.0 item. Se você tiver derivado uma classe de SyndicationItem e quiser serializá-la, use o Rss20ItemFormatter<TSyndicationItem> formatador.If you have derived a class from SyndicationItem and want to serialize it, use the Rss20ItemFormatter<TSyndicationItem> formatter.

Construtores

Rss20ItemFormatter() Rss20ItemFormatter() Rss20ItemFormatter() Rss20ItemFormatter()

Cria uma nova instância da classe Rss20ItemFormatter.Creates a new instance of the Rss20ItemFormatter class.

Rss20ItemFormatter(SyndicationItem) Rss20ItemFormatter(SyndicationItem) Rss20ItemFormatter(SyndicationItem) Rss20ItemFormatter(SyndicationItem)

Cria uma nova instância da classe Rss20ItemFormatter.Creates a new instance of the Rss20ItemFormatter class.

Rss20ItemFormatter(SyndicationItem, Boolean) Rss20ItemFormatter(SyndicationItem, Boolean) Rss20ItemFormatter(SyndicationItem, Boolean) Rss20ItemFormatter(SyndicationItem, Boolean)

Cria uma nova instância da classe Rss20ItemFormatter.Creates a new instance of the Rss20ItemFormatter class.

Rss20ItemFormatter(Type) Rss20ItemFormatter(Type) Rss20ItemFormatter(Type) Rss20ItemFormatter(Type)

Cria uma nova instância da classe Rss20ItemFormatter.Creates a new instance of the Rss20ItemFormatter class.

Propriedades

Item Item Item Item

Obtém o SyndicationItem associado ao formatador.Gets the SyndicationItem associated with the formatter.

(Inherited from SyndicationItemFormatter)
ItemType ItemType ItemType ItemType

Obtém o tipo do item de sindicalização associado a Rss20ItemFormatter.Gets the type of the syndication item associated with the Rss20ItemFormatter.

PreserveAttributeExtensions PreserveAttributeExtensions PreserveAttributeExtensions PreserveAttributeExtensions

Obtém ou define um valor que especifica se é necessário preservar extensões do atributo durante a serialização.Gets or sets a value that specifies whether to preserve attribute extensions during serialization.

PreserveElementExtensions PreserveElementExtensions PreserveElementExtensions PreserveElementExtensions

Obtém ou define um valor que especifica se é necessário preservar extensões do elemento durante a serialização.Gets or sets a value that specifies whether to preserve element extensions during serialization.

SerializeExtensionsAsAtom SerializeExtensionsAsAtom SerializeExtensionsAsAtom SerializeExtensionsAsAtom

Obtém ou define um valor que especifica se as extensões devem ser serializadas dentro do namespace do Atom 1.0.Gets or sets a value that specifies whether to serialize extensions within the Atom 1.0 namespace.

Version Version Version Version

Obtém a versão de sindicalização usada pelo formatador.Gets the syndication version used by the formatter.

Métodos

CanRead(XmlReader) CanRead(XmlReader) CanRead(XmlReader) CanRead(XmlReader)

Verifica se o XmlReader especificado contém um item de sindicalização RSS 2.0 válido.Verifies whether the specified XmlReader contains a valid RSS 2.0 syndication item.

CreateItemInstance() CreateItemInstance() CreateItemInstance() CreateItemInstance()

Cria uma nova instância SyndicationItem.Creates a new SyndicationItem instance.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Inherited from Object)
ReadFrom(XmlReader) ReadFrom(XmlReader) ReadFrom(XmlReader) ReadFrom(XmlReader)

Lê um item de sindicalização RSS 2.0 da instância de XmlReader especificada.Reads an RSS 2.0 syndication item from the specified XmlReader instance.

SetItem(SyndicationItem) SetItem(SyndicationItem) SetItem(SyndicationItem) SetItem(SyndicationItem)

Associa uma instância SyndicationItem ao SyndicationItemFormatter.Associates a SyndicationItem instance with the SyndicationItemFormatter.

(Inherited from SyndicationItemFormatter)
ToString() ToString() ToString() ToString()

Obtém uma representação de cadeia de caracteres da instância SyndicationItemFormatter.Gets a string representation of the SyndicationItemFormatter instance.

(Inherited from SyndicationItemFormatter)
WriteElementExtensions(XmlWriter, SyndicationCategory, String) WriteElementExtensions(XmlWriter, SyndicationCategory, String) WriteElementExtensions(XmlWriter, SyndicationCategory, String) WriteElementExtensions(XmlWriter, SyndicationCategory, String)

Grava as extensões de elemento da instância SyndicationCategory no XmlWriter especificado na versão de sindicalização especificada.Writes the element extensions in the SyndicationCategory instance to the specified XmlWriter in the specified syndication version.

(Inherited from SyndicationItemFormatter)
WriteElementExtensions(XmlWriter, SyndicationLink, String) WriteElementExtensions(XmlWriter, SyndicationLink, String) WriteElementExtensions(XmlWriter, SyndicationLink, String) WriteElementExtensions(XmlWriter, SyndicationLink, String)

Grava as extensões de elemento da instância SyndicationLink no XmlWriter especificado na versão de sindicalização especificada.Writes the element extensions in the SyndicationLink instance to the specified XmlWriter in the specified syndication version.

(Inherited from SyndicationItemFormatter)
WriteElementExtensions(XmlWriter, SyndicationPerson, String) WriteElementExtensions(XmlWriter, SyndicationPerson, String) WriteElementExtensions(XmlWriter, SyndicationPerson, String) WriteElementExtensions(XmlWriter, SyndicationPerson, String)

Grava as extensões de elemento da instância SyndicationPerson no XmlWriter especificado na versão de sindicalização especificada.Writes the element extensions in the SyndicationPerson instance to the specified XmlWriter in the specified syndication version.

(Inherited from SyndicationItemFormatter)
WriteTo(XmlWriter) WriteTo(XmlWriter) WriteTo(XmlWriter) WriteTo(XmlWriter)

Grava o SyndicationItem associado ao Rss20FeedFormatter no XmlWriter especificado.Writes the SyndicationItem associated with the Rss20FeedFormatter to the specified XmlWriter.

Implantações explícitas de interface

IXmlSerializable.GetSchema() IXmlSerializable.GetSchema() IXmlSerializable.GetSchema() IXmlSerializable.GetSchema()

Implementa o método GetSchema().Implements the GetSchema() method.

IXmlSerializable.ReadXml(XmlReader) IXmlSerializable.ReadXml(XmlReader) IXmlSerializable.ReadXml(XmlReader) IXmlSerializable.ReadXml(XmlReader)

Implementa o método ReadXml(XmlReader).Implements the ReadXml(XmlReader) method.

IXmlSerializable.WriteXml(XmlWriter) IXmlSerializable.WriteXml(XmlWriter) IXmlSerializable.WriteXml(XmlWriter) IXmlSerializable.WriteXml(XmlWriter)

Implementa o método WriteXml(XmlWriter).Implements the WriteXml(XmlWriter) method.

Aplica-se a