Atom10FeedFormatter Atom10FeedFormatter Atom10FeedFormatter Atom10FeedFormatter Class

Definição

Uma classe que serializa uma instância SyndicationFeed para e do 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
Herança
Derivado
Implementações

Exemplos

O código a seguir mostra como criar um SyndicationFeed e serializá-lo para 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()

Comentários

Use essa classe para serializar instâncias SyndicationFeed do e para criar instâncias SyndicationFeed de documentos XML que representem feeds Atom 1.0.Use this class to serialize instances of SyndicationFeed and to create instances of SyndicationFeed from XML documents that represent Atom1.0 feeds. Se você tiver derivado uma classe de SyndicationFeed e quiser serializá-la, use o Atom10FeedFormatter<TSyndicationFeed> formatador.If you have derived a class from SyndicationFeed and want to serialize it, use the Atom10FeedFormatter<TSyndicationFeed> formatter.

Observação

A especificação Atom 1,0 permite que os segundos fracionários sejam especificados em qualquer uma de suas construções de data.The Atom 1.0 specification allows for fractional seconds to be specified in any of its date constructs. Ao serializar e desserializar, a implementação do WCF ignora os segundos fracionários.When serializing and deserializing, the WCF implementation ignores the fractional seconds.

Construtores

Atom10FeedFormatter() Atom10FeedFormatter() Atom10FeedFormatter() Atom10FeedFormatter()

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

Atom10FeedFormatter(SyndicationFeed) Atom10FeedFormatter(SyndicationFeed) Atom10FeedFormatter(SyndicationFeed) Atom10FeedFormatter(SyndicationFeed)

Cria uma nova instância da classe Atom10FeedFormatter com a instância SyndicationFeed especificada.Creates a new instance of the Atom10FeedFormatter class with the specified SyndicationFeed instance.

Atom10FeedFormatter(Type) Atom10FeedFormatter(Type) Atom10FeedFormatter(Type) Atom10FeedFormatter(Type)

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

Propriedades

DateTimeParser DateTimeParser DateTimeParser DateTimeParser Inherited from SyndicationFeedFormatter
Feed Feed Feed Feed

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

(Inherited from SyndicationFeedFormatter)
FeedType FeedType FeedType FeedType

A instância derivada de SyndicationFeed que está associada à instância de Atom10FeedFormatter.The instance derived from SyndicationFeed that is associated with the Atom10FeedFormatter instance.

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.

UriParser UriParser UriParser UriParser Inherited from SyndicationFeedFormatter
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 feed de sindicalização Atom 1.0 válido.Verifies whether the specified XmlReader contains a valid Atom 1.0 syndication feed.

CreateFeedInstance() CreateFeedInstance() CreateFeedInstance() CreateFeedInstance()

Cria um novo SyndicationFeed.Creates a new SyndicationFeed.

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 feed de sindicalização Atom 1.0 da instância XmlReader especificada.Reads an Atom 1.0 syndication feed from the specified XmlReader instance.

ReadItem(XmlReader, SyndicationFeed) ReadItem(XmlReader, SyndicationFeed) ReadItem(XmlReader, SyndicationFeed) ReadItem(XmlReader, SyndicationFeed)

Lê um item de sindicalização da instância de XmlReader usando a instância de SyndicationFeed.Reads a syndication item from XmlReader instance using the SyndicationFeed instance.

ReadItems(XmlReader, SyndicationFeed, Boolean) ReadItems(XmlReader, SyndicationFeed, Boolean) ReadItems(XmlReader, SyndicationFeed, Boolean) ReadItems(XmlReader, SyndicationFeed, Boolean)

Lê uma coleção de instâncias de SyndicationItem do XmlReader especificado.Reads in a collection of SyndicationItem instances from the specified XmlReader.

SetFeed(SyndicationFeed) SetFeed(SyndicationFeed) SetFeed(SyndicationFeed) SetFeed(SyndicationFeed)

Associa uma instância SyndicationFeed ao SyndicationFeedFormatter.Associates a SyndicationFeed instance with the SyndicationFeedFormatter.

(Inherited from SyndicationFeedFormatter)
ToString() ToString() ToString() ToString()

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

(Inherited from SyndicationFeedFormatter)
WriteItem(XmlWriter, SyndicationItem, Uri) WriteItem(XmlWriter, SyndicationItem, Uri) WriteItem(XmlWriter, SyndicationItem, Uri) WriteItem(XmlWriter, SyndicationItem, Uri)

Grava a instância de SyndicationItem especificada no XmlWriter especificado.Writes the specified SyndicationItem instance to the specified XmlWriter.

WriteItems(XmlWriter, IEnumerable<SyndicationItem>, Uri) WriteItems(XmlWriter, IEnumerable<SyndicationItem>, Uri) WriteItems(XmlWriter, IEnumerable<SyndicationItem>, Uri) WriteItems(XmlWriter, IEnumerable<SyndicationItem>, Uri)

Grava um conjunto de instâncias de SyndicationItem no XmlWriter especificado.Writes a collection of SyndicationItem instances to the specified XmlWriter.

WriteTo(XmlWriter) WriteTo(XmlWriter) WriteTo(XmlWriter) WriteTo(XmlWriter)

Grava o SyndicationFeed associado ao Atom10FeedFormatter no XmlWriter especificado.Writes the SyndicationFeed associated with the Atom10FeedFormatter 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