Rss20FeedFormatter Clase

Definición

Una clase que serializa una instancia de SyndicationFeed a y desde el formato RSS 2.0.A class that serializes a SyndicationFeed instance to and from RSS 2.0 format.

public ref class Rss20FeedFormatter : System::ServiceModel::Syndication::SyndicationFeedFormatter, System::Xml::Serialization::IXmlSerializable
public class Rss20FeedFormatter : System.ServiceModel.Syndication.SyndicationFeedFormatter, System.Xml.Serialization.IXmlSerializable
type Rss20FeedFormatter = class
    inherit SyndicationFeedFormatter
    interface IXmlSerializable
Public Class Rss20FeedFormatter
Inherits SyndicationFeedFormatter
Implements IXmlSerializable
Herencia
Rss20FeedFormatter
Derivado
Implementaciones

Ejemplos

El siguiente código muestra cómo crear una SyndicationFeed y serializarla a RSS 2.0.The following code shows how to create a SyndicationFeed and serialize it to RSS 2.0.

    SyndicationFeed feed = new SyndicationFeed("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);

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

    XmlWriter rssWriter = XmlWriter.Create("RSS.xml");
    Rss20FeedFormatter rssFormatter = new Rss20FeedFormatter(feed);
    rssFormatter.WriteTo(rssWriter);
    rssWriter.Close();
Dim feed As SyndicationFeed = New SyndicationFeed("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)

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 = New Rss20FeedFormatter(feed)
rssFormatter.WriteTo(rssWriter)
rssWriter.Close()

Comentarios

Utilice esta clase para serializar instancias de SyndicationFeed y para crear instancias de SyndicationFeed a partir de documentos XML que representan fuentes de RSS 2.0.Use this class to serialize instances of SyndicationFeed and to create instances of SyndicationFeed from XML documents that represent RSS 2.0 feeds. Si ha derivado una clase de SyndicationFeed y desea serializarla, utilice el formateador Rss20FeedFormatter<TSyndicationFeed>.If you have derived a class from SyndicationFeed and want to serialize it, use the Rss20FeedFormatter<TSyndicationFeed> formatter.

Constructores

Rss20FeedFormatter()

Crea una nueva instancia de la clase Rss20FeedFormatter.Creates a new instance of the Rss20FeedFormatter class.

Rss20FeedFormatter(SyndicationFeed)

Crea una nueva instancia de la clase Rss20FeedFormatter con la instancia de SyndicationFeed especificada.Creates a new instance of the Rss20FeedFormatter class with the specified SyndicationFeed instance.

Rss20FeedFormatter(SyndicationFeed, Boolean)

Crea una nueva instancia de la clase Rss20FeedFormatter con la instancia de SyndicationFeed especificada.Creates a new instance of the Rss20FeedFormatter class with the specified SyndicationFeed instance.

Rss20FeedFormatter(Type)

Crea una nueva instancia de la clase Rss20FeedFormatter.Creates a new instance of the Rss20FeedFormatter class.

Propiedades

DateTimeParser (Heredado de SyndicationFeedFormatter)
Feed

Obtiene el SyndicationFeed asociado al formateador.Gets the SyndicationFeed associated with the formatter.

(Heredado de SyndicationFeedFormatter)
FeedType

Instancia derivada de SyndicationFeed que está asociada con la instancia de Rss20FeedFormatter.The instance derived from SyndicationFeed that is associated with the Rss20FeedFormatter instance.

PreserveAttributeExtensions

Obtiene o establece un valor que especifica si conservar las extensiones de atributo durante la serialización.Gets or sets a value that specifies whether to preserve attribute extensions during serialization.

PreserveElementExtensions

Obtiene o establece un valor que especifica si se han de conservar las extensiones de elementos durante la serialización.Gets or sets a value that specifies whether to preserve element extensions during serialization.

SerializeExtensionsAsAtom

Obtiene o establece un valor que especifica si se han serializar las extensiones dentro del espacio de nombres de Atom 1.0.Gets or sets a value that specifies whether to serialize extensions within the Atom 1.0 namespace.

UriParser (Heredado de SyndicationFeedFormatter)
Version

Obtiene la versión de distribución utilizada por el formateador.Gets the syndication version used by the formatter.

Métodos

CanRead(XmlReader)

Verifica si el XmlReader especificado contiene una fuente de distribución RSS 2.0 válida.Verifies whether the specified XmlReader contains a valid RSS 2.0 syndication feed.

CreateFeedInstance()

Crea un nuevo SyndicationFeed.Creates a new SyndicationFeed.

Equals(Object)

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

(Heredado de Object)
GetHashCode()

Sirve como función hash predeterminada.Serves as the default hash function.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Heredado de Object)
ReadFrom(XmlReader)

Lee una fuente de distribución RSS 2.0 a partir de la instancia de XmlReader especificada.Reads an RSS 2.0 syndication feed from the specified XmlReader instance.

ReadItem(XmlReader, SyndicationFeed)

Lee un elemento de distribución a partir de la instancia del XmlReader mediante la instancia d SyndicationFeed.Reads a syndication item from XmlReader instance using the SyndicationFeed instance.

ReadItems(XmlReader, SyndicationFeed, Boolean)

Lee una colección de instancias de SyndicationItem desde el XmlReader especificado.Reads in a collection of SyndicationItem instances from the specified XmlReader.

SetFeed(SyndicationFeed)

Establece la instancia SyndicationFeed asociada al Rss20FeedFormatter.Sets the SyndicationFeed instance associated with the Rss20FeedFormatter.

ToString()

Obtiene una representación de cadena de la instancia del SyndicationFeedFormatter.Gets a string representation of the SyndicationFeedFormatter instance.

(Heredado de SyndicationFeedFormatter)
WriteItem(XmlWriter, SyndicationItem, Uri)

Escribe la instancia de SyndicationItem especificada en el XmlWriter especificado.Writes the specified SyndicationItem instance to the specified XmlWriter.

WriteItems(XmlWriter, IEnumerable<SyndicationItem>, Uri)

Escribe una colección de instancias de SyndicationItem en el XmlWriterespecificado.Writes a collection of SyndicationItem instances to the specified XmlWriter.

WriteTo(XmlWriter)

Escribe el SyndicationFeed asociado con Rss20FeedFormatter para el XmlWriter especificado.Writes the SyndicationFeed associated with the Rss20FeedFormatter to the specified XmlWriter.

Implementaciones de interfaz explícitas

IXmlSerializable.GetSchema()

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

IXmlSerializable.ReadXml(XmlReader)

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

IXmlSerializable.WriteXml(XmlWriter)

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

Se aplica a