System.Xml.Serialization.XmlMapping.IsShallow C# (CSharp) Method

IsShallow() static private method

static private IsShallow ( XmlMapping mappings ) : bool
mappings XmlMapping
return bool
        internal static bool IsShallow(XmlMapping[] mappings) {
            for (int i = 0; i < mappings.Length; i++) {
                if (mappings[i] == null || mappings[i].shallow)
                    return true;
            }
            return false;
        }
    }

Usage Example

        public static Assembly GenerateSerializer(Type[] types, XmlMapping[] mappings, CompilerParameters parameters)
        {
            if ((types == null) || (types.Length == 0))
            {
                return(null);
            }
            if (mappings == null)
            {
                throw new ArgumentNullException("mappings");
            }
            if (XmlMapping.IsShallow(mappings))
            {
                throw new InvalidOperationException(Res.GetString("XmlMelformMapping"));
            }
            Assembly assembly = null;

            for (int i = 0; i < types.Length; i++)
            {
                Type type = types[i];
                if (DynamicAssemblies.IsTypeDynamic(type))
                {
                    throw new InvalidOperationException(Res.GetString("XmlPregenTypeDynamic", new object[] { type.FullName }));
                }
                if (assembly == null)
                {
                    assembly = type.Assembly;
                }
                else if (type.Assembly != assembly)
                {
                    throw new ArgumentException(Res.GetString("XmlPregenOrphanType", new object[] { type.FullName, assembly.Location }), "types");
                }
            }
            return(TempAssembly.GenerateAssembly(mappings, types, null, null, XmlSerializerCompilerParameters.Create(parameters, true), assembly, new Hashtable()));
        }
All Usage Examples Of System.Xml.Serialization.XmlMapping::IsShallow