Atom10ItemFormatter Atom10ItemFormatter Atom10ItemFormatter Atom10ItemFormatter Class

Definição

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

public ref class Atom10ItemFormatter : System::ServiceModel::Syndication::SyndicationItemFormatter, System::Xml::Serialization::IXmlSerializable
public class Atom10ItemFormatter : System.ServiceModel.Syndication.SyndicationItemFormatter, System.Xml.Serialization.IXmlSerializable
type Atom10ItemFormatter = class
    inherit SyndicationItemFormatter
    interface IXmlSerializable
Public Class Atom10ItemFormatter
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://localhost/ItemOne"), "TestItemID", DateTime.Now);

item.Links.Add(new SyndicationLink(new Uri("http://someuri"), "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 atomWriter = XmlWriter.Create("AtomItem.xml");
Atom10ItemFormatter formatter = new Atom10ItemFormatter(item);
formatter.WriteTo(atomWriter);
atomWriter.Close();

Dim item As SyndicationItem = New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http:'localhost/ItemOne"), "TestItemID", DateTime.Now)

item.Links.Add(New SyndicationLink(New Uri("http:'someuri"), "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 atomWriter As XmlWriter = XmlWriter.Create("AtomItem.xml")
Dim formatter As Atom10ItemFormatter = New Atom10ItemFormatter(item)
formatter.WriteTo(atomWriter)
atomWriter.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 contém uma entrada Atom 1,0.Use this class to serialize instances of SyndicationItem and to create an instance of SyndicationItem from an XML document that contains an Atom 1.0 entry. Se você tiver derivado uma classe SyndicationItem e quiser serializá-la, use o Atom10ItemFormatter<TSyndicationItem> formatador em vez disso.If you have derived a class from SyndicationItem and want to serialize it, use the Atom10ItemFormatter<TSyndicationItem> formatter instead.

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

Atom10ItemFormatter() Atom10ItemFormatter() Atom10ItemFormatter() Atom10ItemFormatter()

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

Atom10ItemFormatter(SyndicationItem) Atom10ItemFormatter(SyndicationItem) Atom10ItemFormatter(SyndicationItem) Atom10ItemFormatter(SyndicationItem)

Cria uma nova instância da classe Atom10ItemFormatter com o SyndicationItem especificado.Creates a new instance of the Atom10ItemFormatter class with the specified SyndicationItem.

Atom10ItemFormatter(Type) Atom10ItemFormatter(Type) Atom10ItemFormatter(Type) Atom10ItemFormatter(Type)

Inicializa uma nova instância da classe Atom10ItemFormatter.Initializes a new instance of the Atom10ItemFormatter 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 Atom10ItemFormatter.Gets the type of the syndication item associated with the Atom10ItemFormatter.

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.

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 Atom 1.0 válido.Verifies whether the specified XmlReader contains a valid Atom 1.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 Atom 1.0 da instância XmlReader especificada.Reads an Atom 1.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 Atom10ItemFormatter no XmlWriter especificado.Writes the SyndicationItem associated with the Atom10ItemFormatter 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