ConfigurationElement.DeserializeElement(XmlReader, Boolean) 方法

定义

从配置文件读取 XML。

protected:
 virtual void DeserializeElement(System::Xml::XmlReader ^ reader, bool serializeCollectionKey);
protected public:
 virtual void DeserializeElement(System::Xml::XmlReader ^ reader, bool serializeCollectionKey);
protected virtual void DeserializeElement (System.Xml.XmlReader reader, bool serializeCollectionKey);
protected internal virtual void DeserializeElement (System.Xml.XmlReader reader, bool serializeCollectionKey);
abstract member DeserializeElement : System.Xml.XmlReader * bool -> unit
override this.DeserializeElement : System.Xml.XmlReader * bool -> unit
Protected Overridable Sub DeserializeElement (reader As XmlReader, serializeCollectionKey As Boolean)
Protected Friend Overridable Sub DeserializeElement (reader As XmlReader, serializeCollectionKey As Boolean)

参数

reader
XmlReader

用于读取配置文件的 XmlReader

serializeCollectionKey
Boolean

如果只序列化集合键属性,则为 true;否则为 false

例外

要读取的元素被锁定。

- 或 -

无法识别当前节点的特性。

- 或 -

无法确定当前节点的锁定状态。

示例

以下示例演示如何扩展 DeserializeElement 方法。

protected override void DeserializeElement(
   System.Xml.XmlReader reader, 
    bool serializeCollectionKey)
{
    base.DeserializeElement(reader, 
        serializeCollectionKey);
    // You can your custom processing code here.
}
Protected Overrides Sub DeserializeElement(ByVal reader _
    As System.Xml.XmlReader, _
    ByVal serializeCollectionKey As Boolean)

    MyBase.DeserializeElement(reader, _
        serializeCollectionKey)
    ' Enter your custom processing code here.
End Sub

适用于