protected override ITypeSerializationInfo GetElementTypeInfo(XmlReader reader, IPropertySerializationInfo property)
{
string attr = reader.GetAttribute(TypeField, XMLSchemaInstanceNamespace);
if (attr != null)
{
int separator = attr.IndexOf(':');
if (separator == -1) return GetTypeInfo(reader.LookupNamespace(string.Empty), attr);
var prefix = attr.Substring(0, separator);
var localName = attr.Substring(separator + 1);
return GetTypeInfo(reader.LookupNamespace(prefix), localName);
}
else
{
if (property.PropertyType.IsCollection)
{
return property.PropertyType.CollectionItemType;
}
else
{
return property.PropertyType;
}
}
}