SyndicationCategory Classe

Definição

Uma classe que representa a categoria de um feed de sindicalização.A class that represents the category of a syndication feed.

public ref class SyndicationCategory
public class SyndicationCategory
type SyndicationCategory = class
Public Class SyndicationCategory
Herança
SyndicationCategory

Exemplos

O código a seguir mostra como criar um SyndicationFeed e adicionar um SyndicationItem com um SyndicationCategory .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

Comentários

Uma categoria permite que você atribua uma ou mais palavras-chave que podem ser usadas para pesquisar informações.A category allows you to assign one or more keywords that can be used to search for information.

Construtores

SyndicationCategory()

Inicializa uma nova instância da classe SyndicationCategory.Initializes a new instance of the SyndicationCategory class.

SyndicationCategory(String)

Inicializa uma nova instância da classe SyndicationCategory com o nome especificado.Initializes a new instance of the SyndicationCategory class with the given name.

SyndicationCategory(String, String, String)

Inicializa uma nova instância da classe SyndicationCategory com o nome, esquema e rótulo especificados.Initializes a new instance of the SyndicationCategory class with the specified name, scheme, and label.

SyndicationCategory(SyndicationCategory)

Inicializa uma nova instância da classe SyndicationCategory com a instância SyndicationCategory especificada.Initializes a new instance of the SyndicationCategory class with the specified SyndicationCategory instance.

Propriedades

AttributeExtensions

Obtém as extensões de atributo para esta categoria.Gets the attribute extensions for this category.

ElementExtensions

Obtém as extensões de elemento para esta categoria.Gets the element extensions for this category.

Label

Obtém ou define o rótulo da categoria.Gets or sets the label of the category.

Name

Obtém ou define o nome da categoria.Gets or sets the name of the category.

Scheme

Obtém ou define o esquema da categoria.Gets or sets the scheme of the category.

Métodos

Clone()

Cria uma cópia de uma instância SyndicationCategory.Creates a copy of a SyndicationCategory instance.

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Herdado de Object)
GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Herdado de Object)
GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object.

(Herdado de Object)
TryParseAttribute(String, String, String, String)

Tenta analisar uma extensão de atributo.Attempts to parse an attribute extension.

TryParseElement(XmlReader, String)

Tenta analisar uma extensão de elemento.Attempts to parse an element extension.

WriteAttributeExtensions(XmlWriter, String)

Grava as extensões de atributo no gravador especificado.Writes the attribute extensions to the specified writer.

WriteElementExtensions(XmlWriter, String)

Grava as extensões do elemento no gravador especificado.Writes the element extensions to the specified writer.

Aplica-se a