Rss20ItemFormatter Rss20ItemFormatter Rss20ItemFormatter Rss20ItemFormatter Constructors

Definition

Überlädt

Rss20ItemFormatter() Rss20ItemFormatter() Rss20ItemFormatter()

Erstellt eine neue Instanz der Rss20ItemFormatter-Klasse.Creates a new instance of the Rss20ItemFormatter class.

Rss20ItemFormatter(SyndicationItem) Rss20ItemFormatter(SyndicationItem) Rss20ItemFormatter(SyndicationItem) Rss20ItemFormatter(SyndicationItem)

Erstellt eine neue Instanz der Rss20ItemFormatter-Klasse.Creates a new instance of the Rss20ItemFormatter class.

Rss20ItemFormatter(Type) Rss20ItemFormatter(Type) Rss20ItemFormatter(Type) Rss20ItemFormatter(Type)

Erstellt eine neue Instanz der Rss20ItemFormatter-Klasse.Creates a new instance of the Rss20ItemFormatter class.

Rss20ItemFormatter(SyndicationItem, Boolean) Rss20ItemFormatter(SyndicationItem, Boolean) Rss20ItemFormatter(SyndicationItem, Boolean) Rss20ItemFormatter(SyndicationItem, Boolean)

Erstellt eine neue Instanz der Rss20ItemFormatter-Klasse.Creates a new instance of the Rss20ItemFormatter class.

Rss20ItemFormatter() Rss20ItemFormatter() Rss20ItemFormatter()

Erstellt eine neue Instanz der Rss20ItemFormatter-Klasse.Creates a new instance of the Rss20ItemFormatter class.

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

Rss20ItemFormatter(SyndicationItem) Rss20ItemFormatter(SyndicationItem) Rss20ItemFormatter(SyndicationItem) Rss20ItemFormatter(SyndicationItem)

Erstellt eine neue Instanz der Rss20ItemFormatter-Klasse.Creates a new instance of the Rss20ItemFormatter class.

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)

Parameter

itemToWrite
SyndicationItem SyndicationItem SyndicationItem SyndicationItem

Das SyndicationItem, das serialisiert werden soll.The SyndicationItem to serialize.

Beispiele

Im folgenden Beispiel wird der Aufruf dieses Konstruktors veranschaulicht.The following example shows how to call this constructor.

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)

Rss20ItemFormatter(Type) Rss20ItemFormatter(Type) Rss20ItemFormatter(Type) Rss20ItemFormatter(Type)

Erstellt eine neue Instanz der Rss20ItemFormatter-Klasse.Creates a new instance of the Rss20ItemFormatter class.

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

Parameter

itemTypeToCreate
Type Type Type Type

Die von SyndicationItem abgeleitete Instanz für die Zuweisung zum Rss20ItemFormatter.The instance derived from SyndicationItem to associate with the Rss20ItemFormatter.

Beispiele

Das folgende Codebeispiel zeigt, wie dieser Konstruktor verwendet wird.The following code shows how to use this constructor.

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

Hinweise

Verwenden Sie diesen Konstruktor zur Angabe einer von SyndicationItem abgeleiteten Klasse für die Instanziierung, wenn ein Syndication-Element eingelesen wird.Use this constructor to specify a class derived from SyndicationItem to instantiate when a syndication item is read in.

Rss20ItemFormatter(SyndicationItem, Boolean) Rss20ItemFormatter(SyndicationItem, Boolean) Rss20ItemFormatter(SyndicationItem, Boolean) Rss20ItemFormatter(SyndicationItem, Boolean)

Erstellt eine neue Instanz der Rss20ItemFormatter-Klasse.Creates a new instance of the Rss20ItemFormatter class.

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)

Parameter

itemToWrite
SyndicationItem SyndicationItem SyndicationItem SyndicationItem

Das SyndicationItem, das serialisiert werden soll.The SyndicationItem to serialize.

serializeExtensionsAsAtom
Boolean Boolean Boolean Boolean

Ein Wert, der angibt, ob die in der Spezifikation Atom 1.0, nicht jedoch in der Spezifikation RSS 2.0 angegebenen Elemente serialisiert werden sollen.A value that specifies whether to serialize elements that are defined in the Atom 1.0 specification but not in the RSS 2.0 specification. Der Standardwert ist truesein.The default value is true.

Beispiele

Im folgenden Beispiel wird der Aufruf dieses Konstruktors veranschaulicht.The following example shows how to call this constructor.

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)

Hinweise

Weist der serializeExtensionsAsAtom-Parameter den Wert true auf, werden alle in der Spezifikation Atom 1.0, nicht jedoch in der Spezifikation RSS 2.0 definierten Elemente mit dem Atom 1.0-Namespace serialisiert.If the serializeExtensionsAsAtom parameter is true, all elements defined in the Atom 1.0 specification that are not defined in the RSS 2.0 specification are serialized with the Atom 1.0 namespace.

Gilt für: