共用方式為


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

例外狀況

要讀取的項目已經鎖定。

-或-

無法辨識目前節點的屬性 (Attribute)。

-或-

無法判斷目前節點的鎖定狀態。

範例

下列範例示範如何擴充 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

適用於