อ่านในภาษาอังกฤษ แก้ไข

แชร์ผ่าน


SyndicationItem.Load Method

Definition

Overloads

Load(XmlReader)

Loads a SyndicationItem instance from the specified XmlReader.

Load<TSyndicationItem>(XmlReader)

Loads a SyndicationItem derived object from the specified XmlReader.

Load(XmlReader)

Source:
SyndicationItem.cs
Source:
SyndicationItem.cs
Source:
SyndicationItem.cs

Loads a SyndicationItem instance from the specified XmlReader.

C#
public static System.ServiceModel.Syndication.SyndicationItem Load(System.Xml.XmlReader reader);

Parameters

reader
XmlReader

The XmlReader to read from.

Returns

A SyndicationItem instance.

Exceptions

Invalid XML encountered during read.

Examples

The following example shows how to load a syndication item into a SyndicationItem instance.

C#
XmlReader reader = XmlReader.Create("http://localhost/items/serializedItem.xml");
SyndicationItem item = SyndicationItem.Load(reader);
reader.Close();

Applies to

.NET 10 (package-provided) และรุ่นอื่นๆ
ผลิตภัณฑ์ เวอร์ชัน
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

Load<TSyndicationItem>(XmlReader)

Source:
SyndicationItem.cs
Source:
SyndicationItem.cs
Source:
SyndicationItem.cs

Loads a SyndicationItem derived object from the specified XmlReader.

C#
public static TSyndicationItem Load<TSyndicationItem>(System.Xml.XmlReader reader) where TSyndicationItem : System.ServiceModel.Syndication.SyndicationItem, new();

Type Parameters

TSyndicationItem

The SyndicationItem-derived class to load.

Parameters

reader
XmlReader

The XmlReader to read from.

Returns

TSyndicationItem

A SyndicationItem derived object that contains the syndication item.

Examples

The following code shows how to load a syndication item of the specified type from an XML reader.

C#
XmlReader reader = XmlReader.Create("http://localhost/items/serializedItem.xml");
MySyndicationItem myItem = SyndicationItem.Load<MySyndicationItem>(reader);
reader.Close();

Remarks

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

Applies to

.NET 10 (package-provided) และรุ่นอื่นๆ
ผลิตภัณฑ์ เวอร์ชัน
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)