Atom10FeedFormatter Clase

Definición

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

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

Ejemplos

El siguiente código muestra cómo crear una SyndicationFeed y serializarla a Atom 1.0.The following code shows how to create a SyndicationFeed and serialize it to Atom 1.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://localhost/ItemOne"), "TestItemID", DateTime.Now);

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

XmlWriter atomWriter = XmlWriter.Create("Atom.xml");
Atom10FeedFormatter atomFormatter = new Atom10FeedFormatter(feed);
atomFormatter.WriteTo(atomWriter);
atomWriter.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:'localhost/ItemOne"), "TestItemID", DateTime.Now)

Dim items As List(Of SyndicationItem) = New List(Of SyndicationItem)
items.Add(item)
feed.Items = items

Dim atomWriter As XmlWriter = XmlWriter.Create("Atom.xml")
Dim atomFormatter As Atom10FeedFormatter = New Atom10FeedFormatter(feed)
atomFormatter.WriteTo(atomWriter)
atomWriter.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 Atom1.0.Use this class to serialize instances of SyndicationFeed and to create instances of SyndicationFeed from XML documents that represent Atom1.0 feeds. Si ha derivado una clase de SyndicationFeed y desea serializarla, utilice el formateador Atom10FeedFormatter<TSyndicationFeed>.If you have derived a class from SyndicationFeed and want to serialize it, use the Atom10FeedFormatter<TSyndicationFeed> formatter.

Nota

La especificación Atom 1.0 permite especificar segundos fraccionarios en cualquiera de sus estructuras de fechas.The Atom 1.0 specification allows for fractional seconds to be specified in any of its date constructs. Al serializar y deserializar, la implementación de WCF omite las fracciones de segundo.When serializing and deserializing, the WCF implementation ignores the fractional seconds.

Constructores

Atom10FeedFormatter()

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

Atom10FeedFormatter(SyndicationFeed)

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

Atom10FeedFormatter(Type)

Crea una nueva instancia de la clase Atom10FeedFormatter.Creates a new instance of the Atom10FeedFormatter 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 Atom10FeedFormatter.The instance derived from SyndicationFeed that is associated with the Atom10FeedFormatter 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.

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 Atom 1.0 válida.Verifies whether the specified XmlReader contains a valid Atom 1.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 Object actual.Creates a shallow copy of the current Object.

(Heredado de Object)
ReadFrom(XmlReader)

Lee una fuente de distribución Atom 1.0 a partir de la instancia XmlReader especificada.Reads an Atom 1.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)

Asocia una instancia de SyndicationFeed al SyndicationFeedFormatter.Associates a SyndicationFeed instance with the SyndicationFeedFormatter.

(Heredado de SyndicationFeedFormatter)
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 la SyndicationFeed asociada al Atom10FeedFormatter en el XmlWriter especificado.Writes the SyndicationFeed associated with the Atom10FeedFormatter 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