SyndicationCategory Class

SyndicationCategory Class

 

A class that represents the category of a syndication feed.

Namespace:   System.ServiceModel.Syndication
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

System.Object
  System.ServiceModel.Syndication.SyndicationCategory

public class SyndicationCategory

NameDescription
System_CAPS_pubmethodSyndicationCategory()

Initializes a new instance of the SyndicationCategory class.

System_CAPS_pubmethodSyndicationCategory(String)

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

System_CAPS_pubmethodSyndicationCategory(String, String, String)

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

System_CAPS_protmethodSyndicationCategory(SyndicationCategory)

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

NameDescription
System_CAPS_pubpropertyAttributeExtensions

Gets the attribute extensions for this category.

System_CAPS_pubpropertyElementExtensions

Gets the element extensions for this category.

System_CAPS_pubpropertyLabel

Gets and sets the label of the category.

System_CAPS_pubpropertyName

Gets and sets the name of the category.

System_CAPS_pubpropertyScheme

Gets and sets the scheme of the category.

NameDescription
System_CAPS_pubmethodClone()

Creates a copy of a SyndicationCategory instance.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_protmethodTryParseAttribute(String, String, String, String)

Attempts to parse an attribute extension.

System_CAPS_protmethodTryParseElement(XmlReader, String)

Attempts to parse an element extension.

System_CAPS_protmethodWriteAttributeExtensions(XmlWriter, String)

Writes the attribute extensions to the specified writer.

System_CAPS_protmethodWriteElementExtensions(XmlWriter, String)

Writes the element extensions to the specified writer.

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

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;
        }
    }
}

.NET Framework
Available since 3.5
Silverlight
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft