XmlAttributeEventArgs.ObjectBeingDeserialized Property

 

Gets the object being deserialized.

Namespace:   System.Xml.Serialization
Assembly:  System.Xml (in System.Xml.dll)

public object ObjectBeingDeserialized { get; }

Property Value

Type: System.Object

The object being deserialized.

The following example prints the value returned by the ToString method when the Deserialize method encounters an unknown attribute.

private void serializer_UnknownAttribute(
 object sender, XmlAttributeEventArgs e)
 {
    System.Xml.XmlAttribute attr = e.Attr;

    Console.WriteLine("Unknown Attribute Name and Value:" + 
    attr.Name + "='" + attr.Value + "'");
    Object x = e.ObjectBeingDeserialized;
    Console.WriteLine("ObjectBeingDeserialized: " + x.ToString());
 }

.NET Framework
Available since 1.1
Return to top
Show: