Compartir a través de


Atom10ItemFormatter Constructores

Definición

Crea una nueva instancia de la clase Atom10ItemFormatter.

Sobrecargas

Atom10ItemFormatter()

Crea una nueva instancia de la clase Atom10ItemFormatter.

Atom10ItemFormatter(SyndicationItem)

Crea una nueva instancia de la clase Atom10ItemFormatter con la SyndicationItem especificada.

Atom10ItemFormatter(Type)

Inicializa una nueva instancia de la clase Atom10ItemFormatter.

Atom10ItemFormatter()

Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs

Crea una nueva instancia de la clase Atom10ItemFormatter.

public:
 Atom10ItemFormatter();
public Atom10ItemFormatter ();
Public Sub New ()

Se aplica a

Atom10ItemFormatter(SyndicationItem)

Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs

Crea una nueva instancia de la clase Atom10ItemFormatter con la SyndicationItem especificada.

public:
 Atom10ItemFormatter(System::ServiceModel::Syndication::SyndicationItem ^ itemToWrite);
public Atom10ItemFormatter (System.ServiceModel.Syndication.SyndicationItem itemToWrite);
new System.ServiceModel.Syndication.Atom10ItemFormatter : System.ServiceModel.Syndication.SyndicationItem -> System.ServiceModel.Syndication.Atom10ItemFormatter
Public Sub New (itemToWrite As SyndicationItem)

Parámetros

itemToWrite
SyndicationItem

SyndicationItem que se va a serializar.

Ejemplos

El siguiente ejemplo muestra cómo llamar a este constructor.

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

Se aplica a

Atom10ItemFormatter(Type)

Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs

Inicializa una nueva instancia de la clase Atom10ItemFormatter.

public:
 Atom10ItemFormatter(Type ^ itemTypeToCreate);
public Atom10ItemFormatter (Type itemTypeToCreate);
new System.ServiceModel.Syndication.Atom10ItemFormatter : Type -> System.ServiceModel.Syndication.Atom10ItemFormatter
Public Sub New (itemTypeToCreate As Type)

Parámetros

itemTypeToCreate
Type

Instancia SyndicationItem derivada que se va a asociar a Rss20ItemFormatter.

Ejemplos

En el siguiente código se muestra cómo utilizar este constructor.

Atom10ItemFormatter myItemAtomFormatter = new Atom10ItemFormatter(typeof(MySyndicationItem));
XmlReader atomReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Items");
myItemAtomFormatter.ReadFrom(atomReader);
atomReader.Close();
Dim myItemAtomFormatter As New Atom10ItemFormatter(GetType(MySyndicationItem))
Dim atomReader As XmlReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Items")
myItemAtomFormatter.ReadFrom(atomReader)
atomReader.Close()

Comentarios

Utilice este constructor para especificar una clase derivada de SyndicationItem con el fin de crear instancias cuando se lea un elemento de distribución.

Se aplica a