Breyta

Deila með


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
SyndicationCategory

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()

Initializes a new instance of the SyndicationCategory class.

SyndicationCategory(String, String, String)

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

SyndicationCategory(String)

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

SyndicationCategory(SyndicationCategory)

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

Properties

AttributeExtensions

Gets the attribute extensions for this category.

ElementExtensions

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.

Methods

Clone()

Creates a copy of a SyndicationCategory instance.

Equals(Object)

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

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

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

Attempts to parse an attribute extension.

TryParseElement(XmlReader, String)

Attempts to parse an element extension.

WriteAttributeExtensions(XmlWriter, String)

Writes the attribute extensions to the specified writer.

WriteElementExtensions(XmlWriter, String)

Writes the element extensions to the specified writer.

Applies to