Idioma

Rss20ItemFormatter Construtores

Definição

Cria uma nova instância da Rss20ItemFormatter classe.

Sobrecargas

Nome Descrição
Rss20ItemFormatter()

Cria uma nova instância da Rss20ItemFormatter classe.

Rss20ItemFormatter(SyndicationItem)

Cria uma nova instância da Rss20ItemFormatter classe.

Rss20ItemFormatter(Type)

Cria uma nova instância da Rss20ItemFormatter classe.

Rss20ItemFormatter(SyndicationItem, Boolean)

Cria uma nova instância da Rss20ItemFormatter classe.

Rss20ItemFormatter()

Origem:
Rss20ItemFormatter.cs
Origem:
Rss20ItemFormatter.cs
Origem:
Rss20ItemFormatter.cs
Origem:
Rss20ItemFormatter.cs

Cria uma nova instância da Rss20ItemFormatter classe.

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

Aplica-se a

Rss20ItemFormatter(SyndicationItem)

Origem:
Rss20ItemFormatter.cs
Origem:
Rss20ItemFormatter.cs
Origem:
Rss20ItemFormatter.cs
Origem:
Rss20ItemFormatter.cs

Cria uma nova instância da Rss20ItemFormatter classe.

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

Parâmetros

itemToWrite
SyndicationItem

O SyndicationItem para serializar.

Exemplos

O exemplo seguinte mostra como chamar este construtor.

SyndicationItem item = new SyndicationItem("Test Item", "This is the content for Test Item", new Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now);

item.Links.Add(new SyndicationLink(new Uri("http://Contoso"), "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 rssWriter = XmlWriter.Create("RssItem.xml");
Rss20ItemFormatter formatter = new Rss20ItemFormatter(item);
Dim item As SyndicationItem = New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now)

item.Links.Add(New SyndicationLink(New Uri("http://Contoso"), "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 rssWriter As XmlWriter = XmlWriter.Create("RssItem.xml")
Dim formatter As Rss20ItemFormatter = New Rss20ItemFormatter(item)

Aplica-se a

Rss20ItemFormatter(Type)

Origem:
Rss20ItemFormatter.cs
Origem:
Rss20ItemFormatter.cs
Origem:
Rss20ItemFormatter.cs
Origem:
Rss20ItemFormatter.cs

Cria uma nova instância da Rss20ItemFormatter classe.

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

Parâmetros

itemTypeToCreate
Type

A instância derivada de SyndicationItem para associar ao Rss20ItemFormatter.

Exemplos

O código seguinte mostra como usar este construtor.

Rss20ItemFormatter myItemRssFormatter = new Rss20ItemFormatter(typeof(MySyndicationItem));
XmlReader rssReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Items");
myItemRssFormatter.ReadFrom(rssReader);
rssReader.Close();

Observações

Use este construtor para especificar uma classe derivada de SyndicationItem para instanciar quando um item de sindicação é lido.

Aplica-se a

Rss20ItemFormatter(SyndicationItem, Boolean)

Origem:
Rss20ItemFormatter.cs
Origem:
Rss20ItemFormatter.cs
Origem:
Rss20ItemFormatter.cs
Origem:
Rss20ItemFormatter.cs

Cria uma nova instância da Rss20ItemFormatter classe.

public:
 Rss20ItemFormatter(System::ServiceModel::Syndication::SyndicationItem ^ itemToWrite, bool serializeExtensionsAsAtom);
public Rss20ItemFormatter(System.ServiceModel.Syndication.SyndicationItem itemToWrite, bool serializeExtensionsAsAtom);
new System.ServiceModel.Syndication.Rss20ItemFormatter : System.ServiceModel.Syndication.SyndicationItem * bool -> System.ServiceModel.Syndication.Rss20ItemFormatter
Public Sub New (itemToWrite As SyndicationItem, serializeExtensionsAsAtom As Boolean)

Parâmetros

itemToWrite
SyndicationItem

O SyndicationItem para serializar.

serializeExtensionsAsAtom
Boolean

Um valor que especifica se deve serializar elementos definidos na especificação Atom 1.0, mas não na especificação RSS 2.0. O valor predefinido é true.

Exemplos

O exemplo seguinte mostra como chamar este construtor.

SyndicationItem item = new SyndicationItem("Test Item", "This is the content for Test Item", new Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now);

item.Links.Add(new SyndicationLink(new Uri("http://Contoso"), "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 rssWriter = XmlWriter.Create("RssItem.xml");
Rss20ItemFormatter formatter = new Rss20ItemFormatter(item, true);
Dim item As SyndicationItem = New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now)

item.Links.Add(New SyndicationLink(New Uri("http://Contoso"), "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 rssWriter As XmlWriter = XmlWriter.Create("RssItem.xml")
Dim formatter As Rss20ItemFormatter = New Rss20ItemFormatter(item, True)

Observações

Se o serializeExtensionsAsAtom parâmetro for true, todos os elementos definidos na especificação Atom 1.0 que não estejam definidos na especificação RSS 2.0 são serializados com o namespace Atom 1.0.

Aplica-se a