Sdílet prostřednictvím


SyndicationFeed Konstruktory

Definice

Inicializuje novou instanci SyndicationFeed třídy.

Přetížení

SyndicationFeed()

Inicializuje novou instanci SyndicationFeed třídy.

SyndicationFeed(IEnumerable<SyndicationItem>)

Inicializuje novou instanci SyndicationFeed třídy se zadanou kolekcí SyndicationItem objektů.

SyndicationFeed(SyndicationFeed, Boolean)

Vytvoří novou instanci SyndicationFeed třídy se zadaným informačním kanálem.

SyndicationFeed(String, String, Uri)

Inicializuje novou instanci SyndicationFeed třídy se zadaným názvem, popisem a identifikátorem URI (Uniform Resource Identifier).

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

Inicializuje novou instanci SyndicationFeed třídy se zadaným názvem, popisem, identifikátorem URI a kolekcí SyndicationItem objektů.

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

Vytvoří novou instanci třídy SyndicationFeed.

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

Vytvoří novou instanci třídy SyndicationFeed.

SyndicationFeed()

Inicializuje novou instanci SyndicationFeed třídy.

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

Platí pro

SyndicationFeed(IEnumerable<SyndicationItem>)

Inicializuje novou instanci SyndicationFeed třídy se zadanou kolekcí SyndicationItem objektů.

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

Parametry

items
IEnumerable<SyndicationItem>

Kolekce objektů SyndicationItem.

Příklady

Následující příklad ukazuje, jak volat tento konstruktor.

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)

Poznámky

Kolekce SyndicationItem objektů předaných do tohoto konstruktoru je uložena do vyrovnávací paměti.

Platí pro

SyndicationFeed(SyndicationFeed, Boolean)

Vytvoří novou instanci SyndicationFeed třídy se zadaným informačním kanálem.

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)

Parametry

source
SyndicationFeed

Používá SyndicationFeed se k inicializaci nové instance.

cloneItems
Boolean

Hodnota, která určuje, jestli se mají naklonovat položky ve zdrojové instanci.

Poznámky

Pokud je cloneItems trueparametr , všechny SyndicationItem instance ve zdrojové SyndicationFeed instanci se naklonují a přidají do Items kolekce nové SyndicationFeed instance. cloneItems Pokud je falseparametr , Items kolekce nové SyndicationFeed instance obsahuje odkazy na existující SyndicationItem instance.

Platí pro

SyndicationFeed(String, String, Uri)

Inicializuje novou instanci SyndicationFeed třídy se zadaným názvem, popisem a identifikátorem URI (Uniform Resource Identifier).

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)

Parametry

title
String

Název informačního kanálu.

description
String

Popis informačního kanálu.

feedAlternateLink
Uri

Identifikátor URI informačního kanálu.

Příklady

Následující příklad ukazuje, jak volat tento konstruktor.

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

Platí pro

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

Inicializuje novou instanci SyndicationFeed třídy se zadaným názvem, popisem, identifikátorem URI a kolekcí SyndicationItem objektů.

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

Parametry

title
String

Název informačního kanálu.

description
String

Popis informačního kanálu.

feedAlternateLink
Uri

Identifikátor URI informačního kanálu.

items
IEnumerable<SyndicationItem>

Kolekce objektů SyndicationItem.

Příklady

Následující příklad ukazuje, jak volat tento konstruktor.

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)

Platí pro

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

Vytvoří novou instanci třídy 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)

Parametry

title
String

Název kanálu syndikace.

description
String

Popis kanálu syndikace

feedAlternateLink
Uri

Alternativní identifikátor URI pro kanál syndikace.

id
String

ID kanálu syndikace.

lastUpdatedTime
DateTimeOffset

Obsahuje DateTimeOffset naposledy aktualizovaný kanál syndikace.

Příklady

Následující kód ukazuje, jak tento konstruktor volat.

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)

Platí pro

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

Vytvoří novou instanci třídy 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))

Parametry

title
String

Název kanálu syndikace.

description
String

Popis kanálu syndikace

feedAlternateLink
Uri

Alternativní identifikátor URI pro kanál syndikace.

id
String

ID kanálu syndikace.

lastUpdatedTime
DateTimeOffset

Obsahuje DateTimeOffset naposledy aktualizovaný kanál syndikace.

items
IEnumerable<SyndicationItem>

Kolekce objektů SyndicationItem.

Příklady

Následující kód ukazuje, jak tento konstruktor volat.

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)

Platí pro