SyndicationCategory SyndicationCategory SyndicationCategory SyndicationCategory Class

Definition

A class that represents the category of a syndication feed.

public ref class SyndicationCategory
public class SyndicationCategory
type SyndicationCategory = class
Public Class SyndicationCategory
Inheritance
SyndicationCategorySyndicationCategorySyndicationCategorySyndicationCategory

Examples

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

Remarks

A category allows you to assign one or more keywords that can be used to search for information.

Constructors

SyndicationCategory() SyndicationCategory() SyndicationCategory() SyndicationCategory()

Initializes a new instance of the SyndicationCategory class.

SyndicationCategory(String) SyndicationCategory(String) SyndicationCategory(String) SyndicationCategory(String)

Initializes a new instance of the SyndicationCategory class with the given name.

SyndicationCategory(String, String, String) SyndicationCategory(String, String, String) SyndicationCategory(String, String, String) SyndicationCategory(String, String, String)

Initializes a new instance of the SyndicationCategory class with the specified name, scheme, and label.

SyndicationCategory(SyndicationCategory) SyndicationCategory(SyndicationCategory) SyndicationCategory(SyndicationCategory) SyndicationCategory(SyndicationCategory)

Initializes a new instance of the SyndicationCategory class with the specified SyndicationCategory instance.

Properties

AttributeExtensions AttributeExtensions AttributeExtensions AttributeExtensions

Gets the attribute extensions for this category.

ElementExtensions ElementExtensions ElementExtensions ElementExtensions

Gets the element extensions for this category.

Label Label Label Label

Gets or sets the label of the category.

Name Name Name Name

Gets or sets the name of the category.

Scheme Scheme Scheme Scheme

Gets or sets the scheme of the category.

Methods

Clone() Clone() Clone() Clone()

Creates a copy of a SyndicationCategory instance.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
TryParseAttribute(String, String, String, String) TryParseAttribute(String, String, String, String) TryParseAttribute(String, String, String, String) TryParseAttribute(String, String, String, String)

Attempts to parse an attribute extension.

TryParseElement(XmlReader, String) TryParseElement(XmlReader, String) TryParseElement(XmlReader, String) TryParseElement(XmlReader, String)

Attempts to parse an element extension.

WriteAttributeExtensions(XmlWriter, String) WriteAttributeExtensions(XmlWriter, String) WriteAttributeExtensions(XmlWriter, String) WriteAttributeExtensions(XmlWriter, String)

Writes the attribute extensions to the specified writer.

WriteElementExtensions(XmlWriter, String) WriteElementExtensions(XmlWriter, String) WriteElementExtensions(XmlWriter, String) WriteElementExtensions(XmlWriter, String)

Writes the element extensions to the specified writer.

Applies to