Język

SyndicationCategory Klasa

Definicja

Klasa reprezentująca kategorię kanału syndykacji.

public ref class SyndicationCategory
public class SyndicationCategory
type SyndicationCategory = class
Public Class SyndicationCategory
Dziedziczenie
SyndicationCategory

Przykłady

Poniższy kod pokazuje, jak utworzyć element SyndicationFeed i dodać element SyndicationItem z elementem 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

Uwagi

Kategoria umożliwia przypisanie co najmniej jednego słowa kluczowego, którego można użyć do wyszukiwania informacji.

Konstruktory

Nazwa Opis
SyndicationCategory()

Inicjuje nowe wystąpienie klasy SyndicationCategory.

SyndicationCategory(String, String, String)

Inicjuje SyndicationCategory nowe wystąpienie klasy o określonej nazwie, schemacie i etykiecie.

SyndicationCategory(String)

Inicjuje nowe wystąpienie SyndicationCategory klasy o podanej nazwie.

SyndicationCategory(SyndicationCategory)

Inicjuje nowe wystąpienie SyndicationCategory klasy z określonym SyndicationCategory wystąpieniem.

Właściwości

Nazwa Opis
AttributeExtensions

Pobiera rozszerzenia atrybutów dla tej kategorii.

ElementExtensions

Pobiera rozszerzenia elementów dla tej kategorii.

Label

Pobiera lub ustawia etykietę kategorii.

Name

Pobiera lub ustawia nazwę kategorii.

Scheme

Pobiera lub ustawia schemat kategorii.

Metody

Nazwa Opis
Clone()

Tworzy kopię SyndicationCategory wystąpienia.

Equals(Object)

Określa, czy określony obiekt jest równy bieżącemu obiektowi.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Pobiera Type bieżącego wystąpienia.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Object.

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)
TryParseAttribute(String, String, String, String)

Próbuje przeanalizować rozszerzenie atrybutu.

TryParseElement(XmlReader, String)

Próbuje przeanalizować rozszerzenie elementu.

WriteAttributeExtensions(XmlWriter, String)

Zapisuje rozszerzenia atrybutów do określonego składnika zapisywania.

WriteElementExtensions(XmlWriter, String)

Zapisuje rozszerzenia elementu do określonego składnika zapisywania.

Dotyczy