SyndicationLink.TryParseElement(XmlReader, String) 方法

定义

试图分析元素扩展。Attempts to parse an element extension.

protected public:
 virtual bool TryParseElement(System::Xml::XmlReader ^ reader, System::String ^ version);
protected internal virtual bool TryParseElement (System.Xml.XmlReader reader, string version);
abstract member TryParseElement : System.Xml.XmlReader * string -> bool
override this.TryParseElement : System.Xml.XmlReader * string -> bool
Protected Friend Overridable Function TryParseElement (reader As XmlReader, version As String) As Boolean

参数

reader
XmlReader

要从其中进行读取的 XmlReaderThe XmlReader to read from.

version
String

要在分析时使用的联合版本。The syndication version to use while parsing.

返回

Boolean

一个指定是否已成功分析元素扩展的值。A value that specifies whether the element extension was parsed successfully.

例外

读取过程中遇到无效的 XML。Invalid XML encountered during read.

注解

元素扩展是 Atom 1.0 或 RSS 2.0 规范中未指定的有效 XML 元素。Element extensions are valid XML elements that are not specified in either the Atom 1.0 or RSS 2.0 specifications. 可以添加任何有效的 XML 元素作为扩展名,只要该元素的命名空间与外层命名空间不同。You can add any valid XML element as an extension, provided its namespace is different from the enclosing namespace. 此方法是一个扩展点,您可以利用它来处理自定义元素扩展的反序列化。This method is an extension point that allows you to handle the deserialization of a custom element extension. 为此,必须从 SyndicationLink 中派生一个类,并重写此方法。To do this, you must derive a class from SyndicationLink and override this method. 将为所有无法识别的元素扩展调用此方法。This method is called for all unrecognized element extensions.

适用于