ConfigurationElement.DeserializeElement(XmlReader, Boolean) ConfigurationElement.DeserializeElement(XmlReader, Boolean) ConfigurationElement.DeserializeElement(XmlReader, Boolean) ConfigurationElement.DeserializeElement(XmlReader, Boolean) Method

定义

从配置文件读取 XML。Reads XML from the configuration file.

protected public:
 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 Friend Overridable Sub DeserializeElement (reader As XmlReader, serializeCollectionKey As Boolean)

参数

reader
XmlReader XmlReader XmlReader XmlReader

用于读取配置文件的 XmlReaderThe XmlReader that reads from the configuration file.

serializeCollectionKey
Boolean Boolean Boolean Boolean

如果只序列化集合键属性,则为 true;否则为 falsetrue to serialize only the collection key properties; otherwise, false.

异常

要读取的元素被锁定。The element to read is locked.

-or-

无法识别当前节点的特性。An attribute of the current node is not recognized.

- 或 --or-

无法确定当前节点的锁定状态。The lock status of the current node cannot be determined.

示例

下面的示例演示如何扩展DeserializeElement方法。The following example demonstrates how to extend the DeserializeElement method.

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

适用于