Editar

Compartilhar via


SyndicationFeed.Load Method

Definition

Overloads

Load(XmlReader)

Loads a syndication feed from the specified XML reader.

Load<TSyndicationFeed>(XmlReader)

Loads a SyndicationFeed-derived instance from the specified XmlReader.

Load(XmlReader)

Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs

Loads a syndication feed from the specified XML reader.

public:
 static System::ServiceModel::Syndication::SyndicationFeed ^ Load(System::Xml::XmlReader ^ reader);
public static System.ServiceModel.Syndication.SyndicationFeed Load (System.Xml.XmlReader reader);
static member Load : System.Xml.XmlReader -> System.ServiceModel.Syndication.SyndicationFeed
Public Shared Function Load (reader As XmlReader) As SyndicationFeed

Parameters

reader
XmlReader

The XmlReader to load the feed from.

Returns

A SyndicationFeed that contains the loaded contents.

Examples

The following example demonstrates how to call this method.

XmlReader reader = XmlReader.Create("http://localhost/feeds/serializedFeed.xml");
SyndicationFeed feed = SyndicationFeed.Load(reader);
Dim reader As XmlReader = XmlReader.Create("http:'localhost/feeds/serializedFeed.xml")
Dim feed As SyndicationFeed = SyndicationFeed.Load(reader)

Applies to

Load<TSyndicationFeed>(XmlReader)

Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs

Loads a SyndicationFeed-derived instance from the specified XmlReader.

public:
generic <typename TSyndicationFeed>
 where TSyndicationFeed : System::ServiceModel::Syndication::SyndicationFeedgcnew() static TSyndicationFeed Load(System::Xml::XmlReader ^ reader);
public static TSyndicationFeed Load<TSyndicationFeed> (System.Xml.XmlReader reader) where TSyndicationFeed : System.ServiceModel.Syndication.SyndicationFeed, new();
static member Load : System.Xml.XmlReader -> 'SyndicationFeed (requires 'SyndicationFeed :> System.ServiceModel.Syndication.SyndicationFeed and 'SyndicationFeed : (new : unit -> 'SyndicationFeed))
Public Shared Function Load(Of TSyndicationFeed As {SyndicationFeedNew}) (reader As XmlReader) As TSyndicationFeed

Type Parameters

TSyndicationFeed

The syndication feed type.

Parameters

reader
XmlReader

The XmlReader to read from.

Returns

TSyndicationFeed

A SyndicationFeed-derived instance that contains the feed.

Exceptions

Invalid XML encountered during read.

Examples

The following code shows how to load a syndication feed from an XmlReader instance.

XmlReader reader = XmlReader.Create("http://localhost/feeds/serializedFeed.xml");
SyndicationFeed feed = SyndicationFeed.Load(reader);
Dim reader As XmlReader = XmlReader.Create("http:'localhost/feeds/serializedFeed.xml")
Dim feed As SyndicationFeed = SyndicationFeed.Load(reader)

Remarks

Use this method when you are loading a syndication item into a class derived from SyndicationFeed.

Applies to