ConfigurationElement.OnDeserializeUnrecognizedElement(String, XmlReader) 方法

定義

取得值,指出在還原序列化程序中是否遇到未知的項目。Gets a value indicating whether an unknown element is encountered during deserialization.

protected:
 virtual bool OnDeserializeUnrecognizedElement(System::String ^ element, System::Xml::XmlReader ^ reader);
protected virtual bool OnDeserializeUnrecognizedElement (string element, System.Xml.XmlReader reader);
abstract member OnDeserializeUnrecognizedElement : string * System.Xml.XmlReader -> bool
override this.OnDeserializeUnrecognizedElement : string * System.Xml.XmlReader -> bool
Protected Overridable Function OnDeserializeUnrecognizedElement (element As String, reader As XmlReader) As Boolean

參數

elementName
String

未知的子項目名稱。The name of the unknown subelement.

reader
XmlReader

要用於還原序列化的 XmlReaderThe XmlReader being used for deserialization.

傳回

當還原序列化時遇到未知的項目,則為 true,否則為 falsetrue when an unknown element is encountered while deserializing; otherwise, false.

例外狀況

elementName 所識別的項目已經鎖定。The element identified by elementName is locked.

-或--or- 一或多個項目屬性已經鎖定。One or more of the element's attributes is locked.

-或--or- 無法辨識 elementName,或該項目具有無法辨識的屬性。elementName is unrecognized, or the element has an unrecognized attribute.

-或--or- 項目具有含無效值的布林 (Boolean) 屬性。The element has a Boolean attribute with an invalid value.

-或--or- 已多次嘗試還原序列化屬性。An attempt was made to deserialize a property more than once.

-或--or- 嘗試還原序列化不是該項目之有效成員的屬性 (Property)。An attempt was made to deserialize a property that is not a valid member of the element.

-或--or- 項目不能包含 CDATA 或文字項目。The element cannot contain a CDATA or text element.

備註

當還原序列化 ConfigurationElement 物件時,如果發生未知的屬性,就會叫用 OnDeserializeUnrecognizedElementThe OnDeserializeUnrecognizedElement is invoked when an unknown attribute is encountered while deserializing the ConfigurationElement object.

適用於