XmlNodeEventArgs.ObjectBeingDeserialized 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取正在被反序列化的对象。
public:
property System::Object ^ ObjectBeingDeserialized { System::Object ^ get(); };
public object? ObjectBeingDeserialized { get; }
public object ObjectBeingDeserialized { get; }
member this.ObjectBeingDeserialized : obj
Public ReadOnly Property ObjectBeingDeserialized As Object
属性值
正被反序列化的 Object。
示例
以下示例在方法遇到未知 XML 节点时Deserialize打印方法返回ToString的值。
private:
void serializer_UnknownNode( Object^ /*sender*/, XmlNodeEventArgs^ e )
{
Object^ o = e->ObjectBeingDeserialized;
Console::WriteLine( "Object being deserialized: {0}", o );
}
private void serializer_UnknownNode
(object sender, XmlNodeEventArgs e)
{
object o = e.ObjectBeingDeserialized;
Console.WriteLine("Object being deserialized: "
+ o.ToString());
}
Private Sub serializer_UnknownNode _
(ByVal sender As Object, _
ByVal e As XmlNodeEventArgs)
Dim o As Object = e.ObjectBeingDeserialized
Console.WriteLine("Object being deserialized: " & o.ToString())
End Sub