protected virtual bool IsTypeSerializable(Type type, XmlSerializerTypeInfo serializerTypeInfo)
{
if (type == null)
{
return false;
}
// DataContract attribute
if (AttributeHelper.IsDecoratedWithAttribute<DataContractAttribute>(type))
{
return true;
}
#if NET
// Implements ISerializable
if (type.ImplementsInterfaceEx<ISerializable>())
{
return true;
}
#endif
// Implements IXmlSerializer
if (type.ImplementsInterfaceEx<System.Xml.Serialization.IXmlSerializable>())
{
return true;
}
// Is ModelBase
if (type.IsModelBase())
{
return true;
}
// IsSerializable
return type.IsSerializableEx();
}