Partilhar via


SyndicationFeed Construtores

Definição

Inicializa uma nova instância da classe SyndicationFeed.

Sobrecargas

SyndicationFeed()

Inicializa uma nova instância da classe SyndicationFeed.

SyndicationFeed(IEnumerable<SyndicationItem>)

Inicializa uma nova instância da classe SyndicationFeed com a coleção especificada de objetos SyndicationItem.

SyndicationFeed(SyndicationFeed, Boolean)

Cria uma nova instância da classe SyndicationFeed com o feed especificado.

SyndicationFeed(String, String, Uri)

Inicializa uma nova instância da classe SyndicationFeed com o título, a descrição e o URI (Uniform Resource Identifier) especificados.

SyndicationFeed(String, String, Uri, IEnumerable<SyndicationItem>)

Inicializa uma nova instância da classe SyndicationFeed com o título, a descrição, o URI e a coleção de objetos SyndicationItem especificados.

SyndicationFeed(String, String, Uri, String, DateTimeOffset)

Cria uma nova instância da classe SyndicationFeed.

SyndicationFeed(String, String, Uri, String, DateTimeOffset, IEnumerable<SyndicationItem>)

Cria uma nova instância da classe SyndicationFeed.

SyndicationFeed()

Inicializa uma nova instância da classe SyndicationFeed.

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

Aplica-se a

SyndicationFeed(IEnumerable<SyndicationItem>)

Inicializa uma nova instância da classe SyndicationFeed com a coleção especificada de objetos SyndicationItem.

public:
 SyndicationFeed(System::Collections::Generic::IEnumerable<System::ServiceModel::Syndication::SyndicationItem ^> ^ items);
public SyndicationFeed (System.Collections.Generic.IEnumerable<System.ServiceModel.Syndication.SyndicationItem> items);
new System.ServiceModel.Syndication.SyndicationFeed : seq<System.ServiceModel.Syndication.SyndicationItem> -> System.ServiceModel.Syndication.SyndicationFeed
Public Sub New (items As IEnumerable(Of SyndicationItem))

Parâmetros

items
IEnumerable<SyndicationItem>

Uma coleção de objetos SyndicationItem .

Exemplos

O exemplo a seguir demonstra como chamar esse construtor.

List<SyndicationItem> items = new List<SyndicationItem>();
SyndicationItem item1 = new SyndicationItem();
item1.Title = new TextSyndicationContent("Item 1");
item1.Summary = new TextSyndicationContent("This is Item 1's summary");
item1.Authors.Add(new SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://contoso/jesper"));
item1.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 1");
items.Add(item1);

SyndicationItem item2 = new SyndicationItem();
item2.Title = new TextSyndicationContent("Item 2");
item2.Summary = new TextSyndicationContent("This is Item 2's summary");
item2.Authors.Add(new SyndicationPerson("lene@contoso.com", "Lene Aaling", "http://contoso/lene"));
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2");
items.Add(item2);

SyndicationFeed feed = new SyndicationFeed(items);
Dim items As Collection(Of SyndicationItem) = New Collection(Of SyndicationItem)()
Dim item1 As SyndicationItem = New SyndicationItem()
item1.Title = New TextSyndicationContent("Item 1")
item1.Summary = New TextSyndicationContent("This is Item 1's summary")
item1.Authors.Add(New SyndicationPerson("Jesper@contoso.com", "Jesper Aaberg", "http:'contoso/jesper"))
item1.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 1")

Dim item2 As SyndicationItem = New SyndicationItem()
item2.Title = New TextSyndicationContent("Item 2")
item2.Summary = New TextSyndicationContent("This is Item 2's summary")
item2.Authors.Add(New SyndicationPerson("lene@contoso.com", "Lene Aaling", "http:'contoso/lene"))
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2")

Dim feed As SyndicationFeed = New SyndicationFeed(items)

Comentários

A coleção de SyndicationItem objetos passados para esse construtor é armazenada em buffer.

Aplica-se a

SyndicationFeed(SyndicationFeed, Boolean)

Cria uma nova instância da classe SyndicationFeed com o feed especificado.

protected:
 SyndicationFeed(System::ServiceModel::Syndication::SyndicationFeed ^ source, bool cloneItems);
protected SyndicationFeed (System.ServiceModel.Syndication.SyndicationFeed source, bool cloneItems);
new System.ServiceModel.Syndication.SyndicationFeed : System.ServiceModel.Syndication.SyndicationFeed * bool -> System.ServiceModel.Syndication.SyndicationFeed
Protected Sub New (source As SyndicationFeed, cloneItems As Boolean)

Parâmetros

source
SyndicationFeed

O SyndicationFeed usado para inicializar a nova instância.

cloneItems
Boolean

Um valor que especifica se você deseja clonar os itens na instância de origem.

Comentários

Se o cloneItems parâmetro for true, todas as SyndicationItem instâncias na instância de origem SyndicationFeed serão clonadas e adicionadas à Items coleção da nova SyndicationFeed instância. Se o cloneItems parâmetro for false, a Items coleção da nova SyndicationFeed instância conterá referências às instâncias existentes SyndicationItem .

Aplica-se a

SyndicationFeed(String, String, Uri)

Inicializa uma nova instância da classe SyndicationFeed com o título, a descrição e o URI (Uniform Resource Identifier) especificados.

public:
 SyndicationFeed(System::String ^ title, System::String ^ description, Uri ^ feedAlternateLink);
public SyndicationFeed (string title, string description, Uri feedAlternateLink);
new System.ServiceModel.Syndication.SyndicationFeed : string * string * Uri -> System.ServiceModel.Syndication.SyndicationFeed
Public Sub New (title As String, description As String, feedAlternateLink As Uri)

Parâmetros

title
String

O título do feed.

description
String

A descrição do feed.

feedAlternateLink
Uri

O URI do feed.

Exemplos

O exemplo a seguir demonstra como chamar esse construtor.

SyndicationFeed feed = new SyndicationFeed("My Data Feed", "This is a sample feed", new Uri("http://localhost/MyDataService"));
Dim feed As SyndicationFeed = New SyndicationFeed("My Data Feed", "This is a sample feed", New Uri("http:'localhost/MyDataService"))

Aplica-se a

SyndicationFeed(String, String, Uri, IEnumerable<SyndicationItem>)

Inicializa uma nova instância da classe SyndicationFeed com o título, a descrição, o URI e a coleção de objetos SyndicationItem especificados.

public:
 SyndicationFeed(System::String ^ title, System::String ^ description, Uri ^ feedAlternateLink, System::Collections::Generic::IEnumerable<System::ServiceModel::Syndication::SyndicationItem ^> ^ items);
public SyndicationFeed (string title, string description, Uri feedAlternateLink, System.Collections.Generic.IEnumerable<System.ServiceModel.Syndication.SyndicationItem> items);
new System.ServiceModel.Syndication.SyndicationFeed : string * string * Uri * seq<System.ServiceModel.Syndication.SyndicationItem> -> System.ServiceModel.Syndication.SyndicationFeed
Public Sub New (title As String, description As String, feedAlternateLink As Uri, items As IEnumerable(Of SyndicationItem))

Parâmetros

title
String

O título do feed.

description
String

A descrição do feed.

feedAlternateLink
Uri

O URI do feed.

items
IEnumerable<SyndicationItem>

Uma coleção de objetos SyndicationItem .

Exemplos

O exemplo a seguir demonstra como chamar esse construtor.

List<SyndicationItem> items = new List<SyndicationItem>();
SyndicationItem item1 = new SyndicationItem();
item1.Title = new TextSyndicationContent("Item 1");
item1.Summary = new TextSyndicationContent("This is Item 1's summary");
item1.Authors.Add(new SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://contoso/jesper"));
item1.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 1");
items.Add(item1);

SyndicationItem item2 = new SyndicationItem();
item2.Title = new TextSyndicationContent("Item 2");
item2.Summary = new TextSyndicationContent("This is Item 2's summary");
item2.Authors.Add(new SyndicationPerson("lene@contoso.com", "Lene Aaling", "http://contoso/lene"));
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2");
items.Add(item2);

SyndicationFeed feed = new SyndicationFeed("My Data Feed", "This is a sample feed", new Uri("http://localhost/MyDataService"), items);
Dim items As Collection(Of SyndicationItem) = New Collection(Of SyndicationItem)()
Dim item1 As SyndicationItem = New SyndicationItem()
item1.Title = New TextSyndicationContent("Item 1")
item1.Summary = New TextSyndicationContent("This is Item 1's summary")
item1.Authors.Add(New SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http:'contoso/jesper"))
item1.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 1")
Dim item2 As SyndicationItem = New SyndicationItem()
item2.Title = New TextSyndicationContent("Item 2")
item2.Summary = New TextSyndicationContent("This is Item 2's summary")
item2.Authors.Add(New SyndicationPerson("lene@contoso.com", "Lene Aaling", "http:'contoso/lene"))
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2")

Dim feed As SyndicationFeed = New SyndicationFeed("My Data Feed", "This is a sample feed", New Uri("http:'localhost/MyDataService"), items)

Aplica-se a

SyndicationFeed(String, String, Uri, String, DateTimeOffset)

Cria uma nova instância da classe SyndicationFeed.

public:
 SyndicationFeed(System::String ^ title, System::String ^ description, Uri ^ feedAlternateLink, System::String ^ id, DateTimeOffset lastUpdatedTime);
public SyndicationFeed (string title, string description, Uri feedAlternateLink, string id, DateTimeOffset lastUpdatedTime);
new System.ServiceModel.Syndication.SyndicationFeed : string * string * Uri * string * DateTimeOffset -> System.ServiceModel.Syndication.SyndicationFeed
Public Sub New (title As String, description As String, feedAlternateLink As Uri, id As String, lastUpdatedTime As DateTimeOffset)

Parâmetros

title
String

O título do feed de sindicalização.

description
String

A descrição do feed de sindicalização.

feedAlternateLink
Uri

O URI alternativo do feed de sindicalização.

id
String

A ID do feed de sindicalização.

lastUpdatedTime
DateTimeOffset

O DateTimeOffset que contém a última vez em que o feed de sindicalização foi atualizado.

Exemplos

O código a seguir mostra como chamar esse construtor.

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);
Dim feed As SyndicationFeed = New SyndicationFeed("Feed Title", "Feed Description", New Uri("http:'Feed/Alternate/Link"), "FeedID", DateTime.Now)

Aplica-se a

SyndicationFeed(String, String, Uri, String, DateTimeOffset, IEnumerable<SyndicationItem>)

Cria uma nova instância da classe SyndicationFeed.

public:
 SyndicationFeed(System::String ^ title, System::String ^ description, Uri ^ feedAlternateLink, System::String ^ id, DateTimeOffset lastUpdatedTime, System::Collections::Generic::IEnumerable<System::ServiceModel::Syndication::SyndicationItem ^> ^ items);
public SyndicationFeed (string title, string description, Uri feedAlternateLink, string id, DateTimeOffset lastUpdatedTime, System.Collections.Generic.IEnumerable<System.ServiceModel.Syndication.SyndicationItem> items);
new System.ServiceModel.Syndication.SyndicationFeed : string * string * Uri * string * DateTimeOffset * seq<System.ServiceModel.Syndication.SyndicationItem> -> System.ServiceModel.Syndication.SyndicationFeed
Public Sub New (title As String, description As String, feedAlternateLink As Uri, id As String, lastUpdatedTime As DateTimeOffset, items As IEnumerable(Of SyndicationItem))

Parâmetros

title
String

O título do feed de sindicalização.

description
String

A descrição do feed de sindicalização.

feedAlternateLink
Uri

O URI alternativo do feed de sindicalização.

id
String

A ID do feed de sindicalização.

lastUpdatedTime
DateTimeOffset

O DateTimeOffset que contém a última vez em que o feed de sindicalização foi atualizado.

items
IEnumerable<SyndicationItem>

Uma coleção de objetos SyndicationItem .

Exemplos

O código a seguir mostra como chamar esse construtor.

List<SyndicationItem> items = new List<SyndicationItem>();
SyndicationItem item1 = new SyndicationItem();
item1.Title = new TextSyndicationContent("Item 1");
item1.Summary = new TextSyndicationContent("This is Item 1's summary");
item1.Authors.Add(new SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://contoso/jesper"));
item1.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 1");
items.Add(item1);

SyndicationItem item2 = new SyndicationItem();
item2.Title = new TextSyndicationContent("Item 2");
item2.Summary = new TextSyndicationContent("This is Item 2's summary");
item2.Authors.Add(new SyndicationPerson("lene@contoso.com", "Lene Aaling", "http://contoso/lene"));
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2");
items.Add(item2);

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now, items);
Dim items As New List(Of SyndicationItem)()
Dim item1 = New SyndicationItem()
item1.Title = New TextSyndicationContent("Item 1")
item1.Summary = New TextSyndicationContent("This is Item 1's summary")
item1.Authors.Add(New SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http:'contoso/jesper"))
item1.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 1")
items.Add(item1)

Dim item2 = New SyndicationItem()
item2.Title = New TextSyndicationContent("Item 2")
item2.Summary = New TextSyndicationContent("This is Item 2's summary")
item2.Authors.Add(New SyndicationPerson("lene@contoso.com", "Lene Aaling", "http:'contoso/lene"))
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2")
items.Add(item2)

Dim feed As New SyndicationFeed("Feed Title", "Feed Description", New Uri("http:'Feed/Alternate/Link"), "FeedID", DateTime.Now, items)

Aplica-se a