SyndicationFeed Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the SyndicationFeed class.
Overloads
SyndicationFeed() |
Initializes a new instance of the SyndicationFeed class. |
SyndicationFeed(IEnumerable<SyndicationItem>) |
Initializes a new instance of the SyndicationFeed class with the specified collection of SyndicationItem objects. |
SyndicationFeed(SyndicationFeed, Boolean) |
Creates a new instance of the SyndicationFeed class with the specified feed. |
SyndicationFeed(String, String, Uri) |
Initializes a new instance of the SyndicationFeed class with the specified title, description, and Uniform Resource Identifier (URI). |
SyndicationFeed(String, String, Uri, IEnumerable<SyndicationItem>) |
Initializes a new instance of the SyndicationFeed class with the specified title, description, URI, and collection of SyndicationItem objects. |
SyndicationFeed(String, String, Uri, String, DateTimeOffset) |
Creates a new instance of the SyndicationFeed class. |
SyndicationFeed(String, String, Uri, String, DateTimeOffset, IEnumerable<SyndicationItem>) |
Creates a new instance of the SyndicationFeed class. |
SyndicationFeed()
- Source:
- SyndicationFeed.cs
- Source:
- SyndicationFeed.cs
Initializes a new instance of the SyndicationFeed class.
public:
SyndicationFeed();
public SyndicationFeed ();
Public Sub New ()
Applies to
SyndicationFeed(IEnumerable<SyndicationItem>)
- Source:
- SyndicationFeed.cs
- Source:
- SyndicationFeed.cs
Initializes a new instance of the SyndicationFeed class with the specified collection of SyndicationItem objects.
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))
Parameters
- items
- IEnumerable<SyndicationItem>
A collection of SyndicationItem objects.
Examples
The following example demonstrates how to call this constructor.
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)
Remarks
The collection of SyndicationItem objects passed into this constructor is buffered.
Applies to
SyndicationFeed(SyndicationFeed, Boolean)
- Source:
- SyndicationFeed.cs
- Source:
- SyndicationFeed.cs
Creates a new instance of the SyndicationFeed class with the specified feed.
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)
Parameters
- source
- SyndicationFeed
The SyndicationFeed used to initialize the new instance.
- cloneItems
- Boolean
A value that specifies whether to clone the items in the source instance.
Remarks
If the cloneItems
parameter is true
, all SyndicationItem instances in the source SyndicationFeed instance are cloned and added to the Items collection of the new SyndicationFeed instance. If the cloneItems
parameter is false
, the Items collection of the new SyndicationFeed instance contains references to the existing SyndicationItem instances.
Applies to
SyndicationFeed(String, String, Uri)
- Source:
- SyndicationFeed.cs
- Source:
- SyndicationFeed.cs
Initializes a new instance of the SyndicationFeed class with the specified title, description, and Uniform Resource Identifier (URI).
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)
Parameters
- title
- String
The title of the feed.
- description
- String
The description of the feed.
- feedAlternateLink
- Uri
The URI for the feed.
Examples
The following example demonstrates how to call this constructor.
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"))
Applies to
SyndicationFeed(String, String, Uri, IEnumerable<SyndicationItem>)
- Source:
- SyndicationFeed.cs
- Source:
- SyndicationFeed.cs
Initializes a new instance of the SyndicationFeed class with the specified title, description, URI, and collection of SyndicationItem objects.
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))
Parameters
- title
- String
The title of the feed.
- description
- String
The description of the feed.
- feedAlternateLink
- Uri
The URI for the feed.
- items
- IEnumerable<SyndicationItem>
A collection of SyndicationItem objects.
Examples
The following example demonstrates how to call this constructor.
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)
Applies to
SyndicationFeed(String, String, Uri, String, DateTimeOffset)
- Source:
- SyndicationFeed.cs
- Source:
- SyndicationFeed.cs
Creates a new instance of the SyndicationFeed class.
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)
Parameters
- title
- String
The syndication feed title.
- description
- String
The syndication feed description.
- feedAlternateLink
- Uri
The alternate URI for the syndication feed.
- id
- String
The ID of the syndication feed.
- lastUpdatedTime
- DateTimeOffset
The DateTimeOffset that contains the last time the syndication feed was updated.
Examples
The following code shows how to call this constructor.
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)
Applies to
SyndicationFeed(String, String, Uri, String, DateTimeOffset, IEnumerable<SyndicationItem>)
- Source:
- SyndicationFeed.cs
- Source:
- SyndicationFeed.cs
Creates a new instance of the SyndicationFeed class.
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))
Parameters
- title
- String
The syndication feed title.
- description
- String
The syndication feed description.
- feedAlternateLink
- Uri
The alternate URI for the syndication feed.
- id
- String
The ID of the syndication feed.
- lastUpdatedTime
- DateTimeOffset
The DateTimeOffset that contains the last time the syndication feed was updated.
- items
- IEnumerable<SyndicationItem>
A collection of SyndicationItem objects.
Examples
The following code shows how to call this constructor.
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)