public static TypeMap CreateTypeMap (Type type)
{
object [] atts = type.GetCustomAttributes (typeof (DataContractAttribute), true);
if (atts.Length == 1)
return CreateTypeMap (type, (DataContractAttribute) atts [0]);
atts = type.GetCustomAttributes (typeof (SerializableAttribute), false);
if (atts.Length == 1)
return CreateTypeMap (type, null);
if (IsPrimitiveType (type))
return null;
#if MOONLIGHT
if (ExternalTypeMap.HasType (type))
return new ExternalTypeMap (type);
#endif
return CreateDefaultTypeMap (type);
}