SyndicationCategory Klasa

Definicja

Klasa reprezentująca kategorię źródła danych 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 za pomocą elementu 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

SyndicationCategory()

Inicjuje nowe wystąpienie klasy SyndicationCategory.

SyndicationCategory(String)

Inicjuje SyndicationCategory nowe wystąpienie klasy o podanej nazwie.

SyndicationCategory(String, String, String)

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

SyndicationCategory(SyndicationCategory)

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

Właściwości

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

Clone()

Tworzy kopię SyndicationCategory wystąpienia.

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

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

(Odziedziczone po Object)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
MemberwiseClone()

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

(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