Editar

Partilhar via


SyndicationCategory Constructors

Definition

Initializes a new instance of the SyndicationCategory class.

Overloads

SyndicationCategory()

Initializes a new instance of the SyndicationCategory class.

SyndicationCategory(SyndicationCategory)

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

SyndicationCategory(String)

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

SyndicationCategory(String, String, String)

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

SyndicationCategory()

Source:
SyndicationCategory.cs
Source:
SyndicationCategory.cs
Source:
SyndicationCategory.cs

Initializes a new instance of the SyndicationCategory class.

public:
 SyndicationCategory();
public SyndicationCategory ();
Public Sub New ()

Applies to

SyndicationCategory(SyndicationCategory)

Source:
SyndicationCategory.cs
Source:
SyndicationCategory.cs
Source:
SyndicationCategory.cs

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

protected:
 SyndicationCategory(System::ServiceModel::Syndication::SyndicationCategory ^ source);
protected SyndicationCategory (System.ServiceModel.Syndication.SyndicationCategory source);
new System.ServiceModel.Syndication.SyndicationCategory : System.ServiceModel.Syndication.SyndicationCategory -> System.ServiceModel.Syndication.SyndicationCategory
Protected Sub New (source As SyndicationCategory)

Parameters

source
SyndicationCategory

The SyndicationCategory instance to initialize the new SyndicationCategory instance.

Applies to

SyndicationCategory(String)

Source:
SyndicationCategory.cs
Source:
SyndicationCategory.cs
Source:
SyndicationCategory.cs

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

public:
 SyndicationCategory(System::String ^ name);
public SyndicationCategory (string name);
new System.ServiceModel.Syndication.SyndicationCategory : string -> System.ServiceModel.Syndication.SyndicationCategory
Public Sub New (name As String)

Parameters

name
String

The name of the category.

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

Applies to

SyndicationCategory(String, String, String)

Source:
SyndicationCategory.cs
Source:
SyndicationCategory.cs
Source:
SyndicationCategory.cs

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

public:
 SyndicationCategory(System::String ^ name, System::String ^ scheme, System::String ^ label);
public SyndicationCategory (string name, string scheme, string label);
new System.ServiceModel.Syndication.SyndicationCategory : string * string * string -> System.ServiceModel.Syndication.SyndicationCategory
Public Sub New (name As String, scheme As String, label As String)

Parameters

name
String

The name of the category.

scheme
String

A Uniform Resource Identifier (URI) that represents the categorization scheme to which this category belongs.

label
String

A human-readable attribute that describes the category.

Examples

The following code demonstrates how to call this constructor.

SyndicationCategory category = new SyndicationCategory("MyCategory", "http://contoso/MyCategory", "Contoso Category");
Dim category As New SyndicationCategory("MyCategory", "http://contoso/MyCategory", "Contoso Category")

Applies to