SyndicationFeed.WriteElementExtensions(XmlWriter, String) 方法

定义

使用指定的联合版本将元素扩展写入指定的 XmlWriterWrites the element extensions to the specified XmlWriter using the specified syndication version.

protected public:
 virtual void WriteElementExtensions(System::Xml::XmlWriter ^ writer, System::String ^ version);
protected internal virtual void WriteElementExtensions (System.Xml.XmlWriter writer, string version);
abstract member WriteElementExtensions : System.Xml.XmlWriter * string -> unit
override this.WriteElementExtensions : System.Xml.XmlWriter * string -> unit
Protected Friend Overridable Sub WriteElementExtensions (writer As XmlWriter, version As String)

参数

writer
XmlWriter

要向其中进行写入的 XmlReaderThe XmlReader to write to.

version
String

要在写入时使用的联合版本。The syndication version to use while writing.

注解

元素扩展是 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 serialization of custom element extensions. 为此,必须从 SyndicationFeed 中派生一个类,并重写此方法。To do this, you must derive a class from SyndicationFeed and override this method. 将为所有无法识别的元素扩展调用此方法。This method is called for all unrecognized element extensions.

适用于