SetBaseMapping() приватный Метод

private SetBaseMapping ( SerializableMapping mapping ) : void
mapping SerializableMapping
Результат void
        internal void SetBase(SerializableMapping mapping, XmlQualifiedName baseQname) {

            if (baseQname.IsEmpty) return;
            if (baseQname.Namespace == XmlSchema.Namespace) return;
            XmlSchemaSet schemas = mapping.Schemas;
            ArrayList srcSchemas = (ArrayList)schemas.Schemas(baseQname.Namespace);

            if (srcSchemas.Count == 0) {
                throw new InvalidOperationException(Res.GetString(Res.XmlMissingSchema, baseQname.Namespace));
            }
            if (srcSchemas.Count > 1) {
                throw new InvalidOperationException(Res.GetString(Res.XmlGetSchemaInclude, baseQname.Namespace, typeof(IXmlSerializable).Name, "GetSchema"));
            }
            XmlSchema s = (XmlSchema)srcSchemas[0];

            XmlSchemaType t = (XmlSchemaType)s.SchemaTypes[baseQname];
            t = t.Redefined != null ? t.Redefined : t;

            if (serializables[baseQname] == null) {
                SerializableMapping baseMapping = new SerializableMapping(baseQname, schemas);
                SetBase(baseMapping, t.DerivedFrom);
                serializables.Add(baseQname, baseMapping);
            }
            mapping.SetBaseMapping((SerializableMapping)serializables[baseQname]);
        }
 internal void SetBase(SerializableMapping mapping, XmlQualifiedName baseQname)
 {
     if (!baseQname.IsEmpty && (baseQname.Namespace != "http://www.w3.org/2001/XMLSchema"))
     {
         XmlSchemaSet schemas = mapping.Schemas;
         ArrayList list = (ArrayList) schemas.Schemas(baseQname.Namespace);
         if (list.Count == 0)
         {
             throw new InvalidOperationException(Res.GetString("XmlMissingSchema", new object[] { baseQname.Namespace }));
         }
         if (list.Count > 1)
         {
             throw new InvalidOperationException(Res.GetString("XmlGetSchemaInclude", new object[] { baseQname.Namespace, typeof(IXmlSerializable).Name, "GetSchema" }));
         }
         XmlSchema schema = (XmlSchema) list[0];
         XmlSchemaType type = (XmlSchemaType) schema.SchemaTypes[baseQname];
         type = (type.Redefined != null) ? type.Redefined : type;
         if (this.serializables[baseQname] == null)
         {
             SerializableMapping mapping2 = new SerializableMapping(baseQname, schemas);
             this.SetBase(mapping2, type.DerivedFrom);
             this.serializables.Add(baseQname, mapping2);
         }
         mapping.SetBaseMapping((SerializableMapping) this.serializables[baseQname]);
     }
 }