SyndicationFeed.TryParseAttribute(String, String, String, String) 方法

定义

试图分析属性扩展。Attempts to parse an attribute extension.

protected public:
 virtual bool TryParseAttribute(System::String ^ name, System::String ^ ns, System::String ^ value, System::String ^ version);
protected internal virtual bool TryParseAttribute (string name, string ns, string value, string version);
abstract member TryParseAttribute : string * string * string * string -> bool
override this.TryParseAttribute : string * string * string * string -> bool
Protected Friend Overridable Function TryParseAttribute (name As String, ns As String, value As String, version As String) As Boolean

参数

name
String

元素的名称。The name of the element.

ns
String

元素的命名空间。The namespace of the element.

value
String

要分析的属性。The attribute to parse.

version
String

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

返回

Boolean

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

例外

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

注解

属性扩展是 Atom 1.0 或 RSS 2.0 规范未定义的自定义属性。Attribute extensions are custom attributes that are not defined by the Atom 1.0 or RSS 2.0 specifications. 它们被序列化为 <feed> Atom 1.0) 的 (的属性或 <rss> RSS 1.0) 元素 (,这取决于所使用的联合版本。They are serialized as an attribute of the <feed> (for Atom 1.0) or <rss> (for RSS 1.0) element, which depends upon the syndication version being used. 此方法是一个扩展点,您可以利用它来处理自定义属性扩展的反序列化。This method is an extension point that allows you to handle the deserialization of a custom attribute extension. 为此,必须从 SyndicationFeed 中派生一个类,并重写此方法。To do this, you must derive a class from SyndicationFeed and override this method. 将为所有无法识别的属性扩展调用此方法。This method is called for all unrecognized attribute extensions.

适用于