internal SchemaObjectDictionary CreateSchemaObjects()
        {
            SchemaObjectDictionary schemaObjects = new SchemaObjectDictionary();
            ICollection schemaList = schemaSet.Schemas();
            List<XmlSchemaType> knownTypesForObject = new List<XmlSchemaType>();
            schemaObjects.Add(SchemaExporter.AnytypeQualifiedName, new SchemaObjectInfo(null, null, null, knownTypesForObject));

            foreach (XmlSchema schema in schemaList)
            {
                if (schema.TargetNamespace != Globals.SerializationNamespace)
                {
                    foreach (XmlSchemaObject schemaObj in schema.SchemaTypes.Values)
                    {
                        XmlSchemaType schemaType = schemaObj as XmlSchemaType;
                        if (schemaType != null)
                        {
                            knownTypesForObject.Add(schemaType);

                            XmlQualifiedName currentTypeName = new XmlQualifiedName(schemaType.Name, schema.TargetNamespace);
                            SchemaObjectInfo schemaObjectInfo;
                            if (schemaObjects.TryGetValue(currentTypeName, out schemaObjectInfo))
                            {
                                schemaObjectInfo.type = schemaType;
                                schemaObjectInfo.schema = schema;
                            }
                            else
                            {
                                schemaObjects.Add(currentTypeName, new SchemaObjectInfo(schemaType, null, schema, null));
                            }

                            XmlQualifiedName baseTypeName = GetBaseTypeName(schemaType);
                            if (baseTypeName != null)
                            {
                                SchemaObjectInfo baseTypeInfo;
                                if (schemaObjects.TryGetValue(baseTypeName, out baseTypeInfo))
                                {
                                    if (baseTypeInfo.knownTypes == null)
                                    {
                                        baseTypeInfo.knownTypes = new List<XmlSchemaType>();
                                    }
                                }
                                else
                                {
                                    baseTypeInfo = new SchemaObjectInfo(null, null, null, new List<XmlSchemaType>());
                                    schemaObjects.Add(baseTypeName, baseTypeInfo);
                                }
                                baseTypeInfo.knownTypes.Add(schemaType);
                            }
                        }
                    }
                    foreach (XmlSchemaObject schemaObj in schema.Elements.Values)
                    {
                        XmlSchemaElement schemaElement = schemaObj as XmlSchemaElement;
                        if (schemaElement != null)
                        {
                            XmlQualifiedName currentElementName = new XmlQualifiedName(schemaElement.Name, schema.TargetNamespace);
                            SchemaObjectInfo schemaObjectInfo;
                            if (schemaObjects.TryGetValue(currentElementName, out schemaObjectInfo))
                            {
                                schemaObjectInfo.element = schemaElement;
                                schemaObjectInfo.schema = schema;
                            }
                            else
                            {
                                schemaObjects.Add(currentElementName, new SchemaObjectInfo(null, schemaElement, schema, null));
                            }
                        }
                    }
                }
            }
            return schemaObjects;
        }
 internal Dictionary<XmlQualifiedName, SchemaObjectInfo> CreateSchemaObjects()
 {
     Dictionary<XmlQualifiedName, SchemaObjectInfo> dictionary = new Dictionary<XmlQualifiedName, SchemaObjectInfo>();
     ICollection is2 = this.schemaSet.Schemas();
     List<XmlSchemaType> knownTypes = new List<XmlSchemaType>();
     dictionary.Add(SchemaExporter.AnytypeQualifiedName, new SchemaObjectInfo(null, null, null, knownTypes));
     foreach (XmlSchema schema in is2)
     {
         if (schema.TargetNamespace != "http://schemas.microsoft.com/2003/10/Serialization/")
         {
             foreach (XmlSchemaObject obj2 in schema.SchemaTypes.Values)
             {
                 XmlSchemaType item = obj2 as XmlSchemaType;
                 if (item != null)
                 {
                     SchemaObjectInfo info;
                     knownTypes.Add(item);
                     XmlQualifiedName key = new XmlQualifiedName(item.Name, schema.TargetNamespace);
                     if (dictionary.TryGetValue(key, out info))
                     {
                         info.type = item;
                         info.schema = schema;
                     }
                     else
                     {
                         dictionary.Add(key, new SchemaObjectInfo(item, null, schema, null));
                     }
                     XmlQualifiedName baseTypeName = this.GetBaseTypeName(item);
                     if (baseTypeName != null)
                     {
                         SchemaObjectInfo info2;
                         if (dictionary.TryGetValue(baseTypeName, out info2))
                         {
                             if (info2.knownTypes == null)
                             {
                                 info2.knownTypes = new List<XmlSchemaType>();
                             }
                         }
                         else
                         {
                             info2 = new SchemaObjectInfo(null, null, null, new List<XmlSchemaType>());
                             dictionary.Add(baseTypeName, info2);
                         }
                         info2.knownTypes.Add(item);
                     }
                 }
             }
             foreach (XmlSchemaObject obj3 in schema.Elements.Values)
             {
                 XmlSchemaElement element = obj3 as XmlSchemaElement;
                 if (element != null)
                 {
                     SchemaObjectInfo info3;
                     XmlQualifiedName name3 = new XmlQualifiedName(element.Name, schema.TargetNamespace);
                     if (dictionary.TryGetValue(name3, out info3))
                     {
                         info3.element = element;
                         info3.schema = schema;
                     }
                     else
                     {
                         dictionary.Add(name3, new SchemaObjectInfo(null, element, schema, null));
                     }
                 }
             }
         }
     }
     return dictionary;
 }