bool WriteDerivedTypes(StructMapping mapping, string n, string ns, object o, bool isNullable)
{
Type t = o.GetType();
for (StructMapping derived = mapping.DerivedMappings; derived != null; derived = derived.NextDerivedMapping)
{
if (t == derived.TypeDesc.Type)
{
WriteStructMethod(derived, n, ns, o, isNullable, needType: true);
return true;
}
if (WriteDerivedTypes(derived, n, ns, o, isNullable))
{
return true;
}
}
return false;
}