SyndicationItem.Categories 속성

정의

배포 항목의 배포 범주를 가져옵니다.

public:
 property System::Collections::ObjectModel::Collection<System::ServiceModel::Syndication::SyndicationCategory ^> ^ Categories { System::Collections::ObjectModel::Collection<System::ServiceModel::Syndication::SyndicationCategory ^> ^ get(); };
public System.Collections.ObjectModel.Collection<System.ServiceModel.Syndication.SyndicationCategory> Categories { get; }
member this.Categories : System.Collections.ObjectModel.Collection<System.ServiceModel.Syndication.SyndicationCategory>
Public ReadOnly Property Categories As Collection(Of SyndicationCategory)

속성 값

Collection<SyndicationCategory>

배포 항목의 범주를 나타내는 SyndicationCategory 개체 컬렉션입니다.

예제

다음 코드에서는 CategoriesSyndicationItem 컬렉션에 범주를 추가하는 방법을 보여 줍니다.

SyndicationItem item = new SyndicationItem("Item Title", "Item Content", new Uri("http://Item/Alternate/Link"));
item.Categories.Add(new SyndicationCategory("MyFeedCategory"));
Dim item As New SyndicationItem("Item Title", "Item Content", New Uri("http:' Item/Alternate/Link"))
item.Categories.Add(New SyndicationCategory("MyFeedCategory"))

다음 XML은 범주가 있는 SyndicationItem 인스턴스를 Atom 1.0으로 직렬화하는 방법을 보여 있습니다.

<entry>
  <id>Item ID</id>
  <title type="text">My Item</title>
  <updated>2007-03-16T23:02:54Z</updated>
  <author>
    <name>Jesper Aaberg</name>
    <uri>http://contoso/Jesper</uri>
    <email>jesper@contoso.com</email>
  </author>
  <link rel="alternate" href="http://someserver/MyItem" />
  <link rel="alternate" type="text/html" title="Alternate Link" length="1000" href="http://otherserver/Item" />
  <category term="Category One" />
  <content type="text">This is some content</content>
</entry>

다음 XML은 범주가 있는 SyndicationItem 인스턴스를 RSS 2.0으로 직렬화하는 방법을 보여 줍니다.

<item>
  <guid isPermaLink="false">Item ID</guid>
  <link>http://someserver/MyItem</link>
  <author>lene@contoso.com</author>
  <category>Category One</category>
  <title>내 항목</title>

  <description>일부 콘텐츠입니다.</description>
  <a10:link rel="alternate" type="text/html" title="Alternate Link" length="1000" href="http://otherserver/Item" />
  <a10:updated>2007-03-16T23:02:54Z</a10:updated>
</item>

설명

Atom 1.0 또는 RSS 2.0 <category> 으로 직렬화하면 컬렉션의 각 범주에 Categories 대해 요소가 만들어집니다.

적용 대상