System.Xml.Serialization.XmlSerializer.FromTypes C# (CSharp) Method

FromTypes() public static method

public static FromTypes ( Type types ) : System.Xml.Serialization.XmlSerializer[]
types System.Type
return System.Xml.Serialization.XmlSerializer[]
        public static XmlSerializer[] FromTypes(Type[] types)
        {
            if (types == null)
                return Array.Empty<XmlSerializer>();

#if NET_NATIVE
            var serializers = new XmlSerializer[types.Length];
            for (int i = 0; i < types.Length; i++)
            {
                serializers[i] = new XmlSerializer(types[i]);
            }
            return serializers;
#else
            XmlReflectionImporter importer = new XmlReflectionImporter();
            XmlTypeMapping[] mappings = new XmlTypeMapping[types.Length];
            for (int i = 0; i < types.Length; i++)
            {
                mappings[i] = importer.ImportTypeMapping(types[i]);
            }
            return FromMappings(mappings);
#endif
        }