SyndicationItem 构造函数

定义

初始化 SyndicationItem 类的新实例。

重载

SyndicationItem()

初始化 SyndicationItem 类的新实例。

SyndicationItem(SyndicationItem)

使用指定的 SyndicationItem 实例初始化 SyndicationItem 类的新实例。

SyndicationItem(String, String, Uri)

使用指定的标题、内容和链接初始化 SyndicationItem 类的新实例。

SyndicationItem(String, SyndicationContent, Uri, String, DateTimeOffset)

初始化 SyndicationItem 类的新实例。

SyndicationItem(String, String, Uri, String, DateTimeOffset)

初始化 SyndicationItem 类的新实例。

SyndicationItem()

初始化 SyndicationItem 类的新实例。

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

适用于

SyndicationItem(SyndicationItem)

使用指定的 SyndicationItem 实例初始化 SyndicationItem 类的新实例。

protected:
 SyndicationItem(System::ServiceModel::Syndication::SyndicationItem ^ source);
protected SyndicationItem (System.ServiceModel.Syndication.SyndicationItem source);
new System.ServiceModel.Syndication.SyndicationItem : System.ServiceModel.Syndication.SyndicationItem -> System.ServiceModel.Syndication.SyndicationItem
Protected Sub New (source As SyndicationItem)

参数

source
SyndicationItem

用于初始化新 SyndicationItem 实例的 SyndicationItem 实例。

适用于

SyndicationItem(String, String, Uri)

使用指定的标题、内容和链接初始化 SyndicationItem 类的新实例。

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

参数

title
String

项标题。

content
String

项内容。

itemAlternateLinkfeedAlternateLink
Uri

项 URL。

示例

下面的示例演示如何调用此构造函数。

SyndicationItem item = new SyndicationItem("My Item", "This is some content", new Uri("http://SomeServer/MyItem"));
item.Authors.Add(new SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://contoso/jesper"));
item.Categories.Add(new SyndicationCategory("Category One"));
item.Contributors.Add(new SyndicationPerson("lene@contoso.com", "Lene Aaling", "http://contoso/lene"));
item.Copyright = new TextSyndicationContent("Copyright 2007");
item.Links.Add(new SyndicationLink(new Uri("http://OtherServer/Item"), "alternate", "Alternate Link", "text/html", 1000));
item.PublishDate = new DateTime(2007, 2, 23);
item.Summary = new TextSyndicationContent("this is a summary for my item");
Dim item As SyndicationItem = New SyndicationItem("My Item", "This is some content", New Uri("http:' SomeServer/MyItem"))
item.Authors.Add(New SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http:' contoso/jesper"))
item.Categories.Add(New SyndicationCategory("Category One"))
item.Contributors.Add(New SyndicationPerson("lene@contoso.com", "Lene Aaling", "http:' contoso/lene"))
item.Copyright = New TextSyndicationContent("Copyright 2007")
item.Links.Add(New SyndicationLink(New Uri("http:' OtherServer/Item"), "alternate", "Alternate Link", "text/html", 1000))
item.PublishDate = New DateTime(2007, 2, 23)
item.Summary = New TextSyndicationContent("this is a summary for my item")

适用于

SyndicationItem(String, SyndicationContent, Uri, String, DateTimeOffset)

初始化 SyndicationItem 类的新实例。

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

参数

title
String

联合项的标题。

content
SyndicationContent

包含联合项内容的 SyndicationContent 实例。

itemAlternateLinkfeedAlternateLink
Uri

联合项的替换 URI。

id
String

联合项的 ID。

lastUpdatedTime
DateTimeOffset

包含联合项上次更新时间的 DateTimeOffset

示例

下面的代码演示如何调用此构造函数。

TextSyndicationContent content = new TextSyndicationContent("Item Content");
Uri uri = new Uri("http://Item/Alternate/Link");
SyndicationItem item = new SyndicationItem("Item Title", content, uri, "itemID", DateTimeOffset.Now);
Dim content As New TextSyndicationContent("Item Content")
Dim uri As New Uri("http:' Item/Alternate/Link")
Dim item As New SyndicationItem("Item Title", content, uri, "itemID", DateTimeOffset.Now)

适用于

SyndicationItem(String, String, Uri, String, DateTimeOffset)

初始化 SyndicationItem 类的新实例。

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

参数

title
String

联合项的标题。

content
String

联合项的内容。

itemAlternateLinkfeedAlternateLink
Uri

联合项的替换 URI。

id
String

联合项的 ID。

lastUpdatedTime
DateTimeOffset

包含联合项上次更新时间的 DateTimeOffset

示例

下面的代码演示如何调用此构造函数。

SyndicationItem item = new SyndicationItem("Item Title", "Item Content", new Uri("http://Item/Alternate/Link"), "itemID", DateTimeOffset.Now);
Dim item As New SyndicationItem("Item Title", "Item Content", New Uri("http:' Item/Alternate/Link"), "itemID", DateTimeOffset.Now)

适用于