Rss20ItemFormatter Constructors

Definitie

Hiermee maakt u een nieuw exemplaar van de Rss20ItemFormatter klasse.

Overloads

Name Description
Rss20ItemFormatter()

Hiermee maakt u een nieuw exemplaar van de Rss20ItemFormatter klasse.

Rss20ItemFormatter(SyndicationItem)

Hiermee maakt u een nieuw exemplaar van de Rss20ItemFormatter klasse.

Rss20ItemFormatter(Type)

Hiermee maakt u een nieuw exemplaar van de Rss20ItemFormatter klasse.

Rss20ItemFormatter(SyndicationItem, Boolean)

Hiermee maakt u een nieuw exemplaar van de Rss20ItemFormatter klasse.

Rss20ItemFormatter()

Hiermee maakt u een nieuw exemplaar van de Rss20ItemFormatter klasse.

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

Van toepassing op

Rss20ItemFormatter(SyndicationItem)

Hiermee maakt u een nieuw exemplaar van de Rss20ItemFormatter klasse.

public:
 Rss20ItemFormatter(System::ServiceModel::Syndication::SyndicationItem ^ itemToWrite);
public Rss20ItemFormatter(System.ServiceModel.Syndication.SyndicationItem itemToWrite);
new System.ServiceModel.Syndication.Rss20ItemFormatter : System.ServiceModel.Syndication.SyndicationItem -> System.ServiceModel.Syndication.Rss20ItemFormatter
Public Sub New (itemToWrite As SyndicationItem)

Parameters

itemToWrite
SyndicationItem

De SyndicationItem te serialiseren.

Voorbeelden

In het volgende voorbeeld ziet u hoe u deze constructor aanroept.

SyndicationItem item = new SyndicationItem("Test Item", "This is the content for Test Item", new Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now);

item.Links.Add(new SyndicationLink(new Uri("http://Contoso"), "alternate", "MyItemLink", "text/html", 100));
item.PublishDate = new DateTime(1968, 2, 23);
item.LastUpdatedTime = DateTime.Today;
item.SourceFeed = new SyndicationFeed();
item.Summary = new TextSyndicationContent("This the item summary");

XmlWriter rssWriter = XmlWriter.Create("RssItem.xml");
Rss20ItemFormatter formatter = new Rss20ItemFormatter(item);
Dim item As SyndicationItem = New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now)

item.Links.Add(New SyndicationLink(New Uri("http://Contoso"), "alternate", "MyItemLink", "text/html", 100))
item.PublishDate = New DateTime(1968, 2, 23)
item.LastUpdatedTime = DateTime.Today
item.SourceFeed = New SyndicationFeed()
item.Summary = New TextSyndicationContent("This the item summary")

Dim rssWriter As XmlWriter = XmlWriter.Create("RssItem.xml")
Dim formatter As Rss20ItemFormatter = New Rss20ItemFormatter(item)

Van toepassing op

Rss20ItemFormatter(Type)

Hiermee maakt u een nieuw exemplaar van de Rss20ItemFormatter klasse.

public:
 Rss20ItemFormatter(Type ^ itemTypeToCreate);
public Rss20ItemFormatter(Type itemTypeToCreate);
new System.ServiceModel.Syndication.Rss20ItemFormatter : Type -> System.ServiceModel.Syndication.Rss20ItemFormatter
Public Sub New (itemTypeToCreate As Type)

Parameters

itemTypeToCreate
Type

Het exemplaar dat is afgeleid van SyndicationItem om te koppelen aan de Rss20ItemFormatter.

Voorbeelden

De volgende code laat zien hoe u deze constructor gebruikt.

Rss20ItemFormatter myItemRssFormatter = new Rss20ItemFormatter(typeof(MySyndicationItem));
XmlReader rssReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Items");
myItemRssFormatter.ReadFrom(rssReader);
rssReader.Close();

Opmerkingen

Gebruik deze constructor om een klasse op te geven die is afgeleid van SyndicationItem om te instantiƫren wanneer een syndicatie-item wordt gelezen.

Van toepassing op

Rss20ItemFormatter(SyndicationItem, Boolean)

Hiermee maakt u een nieuw exemplaar van de Rss20ItemFormatter klasse.

public:
 Rss20ItemFormatter(System::ServiceModel::Syndication::SyndicationItem ^ itemToWrite, bool serializeExtensionsAsAtom);
public Rss20ItemFormatter(System.ServiceModel.Syndication.SyndicationItem itemToWrite, bool serializeExtensionsAsAtom);
new System.ServiceModel.Syndication.Rss20ItemFormatter : System.ServiceModel.Syndication.SyndicationItem * bool -> System.ServiceModel.Syndication.Rss20ItemFormatter
Public Sub New (itemToWrite As SyndicationItem, serializeExtensionsAsAtom As Boolean)

Parameters

itemToWrite
SyndicationItem

De SyndicationItem te serialiseren.

serializeExtensionsAsAtom
Boolean

Een waarde die aangeeft of elementen moeten worden geserialiseerd die zijn gedefinieerd in de specificatie Atom 1.0, maar niet in de RSS 2.0-specificatie. De standaardwaarde is true.

Voorbeelden

In het volgende voorbeeld ziet u hoe u deze constructor aanroept.

SyndicationItem item = new SyndicationItem("Test Item", "This is the content for Test Item", new Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now);

item.Links.Add(new SyndicationLink(new Uri("http://Contoso"), "alternate", "MyItemLink", "text/html", 100));
item.PublishDate = new DateTime(1968, 2, 23);
item.LastUpdatedTime = DateTime.Today;
item.SourceFeed = new SyndicationFeed();
item.Summary = new TextSyndicationContent("This the item summary");

XmlWriter rssWriter = XmlWriter.Create("RssItem.xml");
Rss20ItemFormatter formatter = new Rss20ItemFormatter(item, true);
Dim item As SyndicationItem = New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now)

item.Links.Add(New SyndicationLink(New Uri("http://Contoso"), "alternate", "MyItemLink", "text/html", 100))
item.PublishDate = New DateTime(1968, 2, 23)
item.LastUpdatedTime = DateTime.Today
item.SourceFeed = New SyndicationFeed()
item.Summary = New TextSyndicationContent("This the item summary")

Dim rssWriter As XmlWriter = XmlWriter.Create("RssItem.xml")
Dim formatter As Rss20ItemFormatter = New Rss20ItemFormatter(item, True)

Opmerkingen

Als de serializeExtensionsAsAtom parameter is true, worden alle elementen die zijn gedefinieerd in de Atom 1.0-specificatie die niet zijn gedefinieerd in de RSS 2.0-specificatie geserialiseerd met de Atom 1.0-naamruimte.

Van toepassing op