SyndicationCategory Class
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.
A class that represents the category of a syndication feed.
public ref class SyndicationCategory
public class SyndicationCategory
type SyndicationCategory = class
Public Class SyndicationCategory
- Inheritance
-
SyndicationCategory
The following code shows how to create a SyndicationFeed and add a SyndicationItem with a SyndicationCategory.
using System;
using System.ServiceModel.Syndication;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace SyndicationCategorySample
{
class Program
{
static void Main(string[] args)
{
SyndicationFeed myFeed = new SyndicationFeed("My Test Feed",
"This is a test feed",
new Uri("http://FeedServer/Test"), "MyFeedId", DateTime.Now);
SyndicationItem myItem = new SyndicationItem("Item One Title",
"Item One Content",
new Uri("http://FeedServer/Test/ItemOne"));
myItem.Categories.Add(new SyndicationCategory("MyCategory"));
Collection<SyndicationItem> items = new Collection<SyndicationItem>();
items.Add(myItem);
myFeed.Items = items;
}
}
}
Imports System.ServiceModel.Syndication
Imports System.Collections.Generic
imports System.Collections.ObjectModel
Module Program
Sub Main()
Dim myFeed As New SyndicationFeed("My Test Feed", _
"This is a test feed", _
New Uri("http://FeedServer/Test"), "MyFeedId", DateTime.Now)
Dim myItem As New SyndicationItem("Item One Title", _
"Item One Content", _
New Uri("http://FeedServer/Test/ItemOne"))
myItem.Categories.Add(New SyndicationCategory("MyCategory"))
Dim items As New Collection(Of SyndicationItem)()
items.Add(myItem)
myFeed.Items = items
End Sub
End Module
A category allows you to assign one or more keywords that can be used to search for information.
Syndication |
Initializes a new instance of the SyndicationCategory class. |
Syndication |
Initializes a new instance of the SyndicationCategory class with the specified name, scheme, and label. |
Syndication |
Initializes a new instance of the SyndicationCategory class with the given name. |
Syndication |
Initializes a new instance of the SyndicationCategory class with the specified SyndicationCategory instance. |
Attribute |
Gets the attribute extensions for this category. |
Element |
Gets the element extensions for this category. |
Label |
Gets or sets the label of the category. |
Name |
Gets or sets the name of the category. |
Scheme |
Gets or sets the scheme of the category. |
Clone() |
Creates a copy of a SyndicationCategory instance. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
To |
Returns a string that represents the current object. (Inherited from Object) |
Try |
Attempts to parse an attribute extension. |
Try |
Attempts to parse an element extension. |
Write |
Writes the attribute extensions to the specified writer. |
Write |
Writes the element extensions to the specified writer. |
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: