Einhugur Serialization Framework for Xojo

XmlSerializer.AddKnownClass Method

Adds known classes which is required when de-serializing polymorphic structures

AddKnownClass(
   classType as Introspection.TypeInfo)

Parameters

classType
Type info for the known class

Remarks

You need to use this method when your class interface does not tell the whole story about the objects it contains.

For example if you have property like

Item as Vehicle

But the actual data your putting in that property is Truck or Motorcycle, both of which inherit from Vehicle class, then you need to add Truck and Motorcycle as known classes since the serializer will not be able to get their class info from your class interface.

See Also

XmlSerializer Class