XmlNodeEventArgs.ObjectBeingDeserialized 属性

定义

获取正在被反序列化的对象。

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

正被反序列化的 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

适用于

另请参阅