System.Runtime.Serialization.SchemaHelper.GetSchemaWithType C# (CSharp) Method

GetSchemaWithType() static private method

static private GetSchemaWithType ( SchemaObjectDictionary schemaInfo, XmlSchemaSet schemas, XmlQualifiedName typeName ) : XmlSchema
schemaInfo SchemaObjectDictionary
schemas System.Xml.Schema.XmlSchemaSet
typeName System.Xml.XmlQualifiedName
return System.Xml.Schema.XmlSchema
        internal static XmlSchema GetSchemaWithType(SchemaObjectDictionary schemaInfo, XmlSchemaSet schemas, XmlQualifiedName typeName)
        {
            SchemaObjectInfo schemaObjectInfo;
            if (schemaInfo.TryGetValue(typeName, out schemaObjectInfo))
            {
                if (schemaObjectInfo.schema != null)
                    return schemaObjectInfo.schema;
            }
            ICollection currentSchemas = schemas.Schemas();
            string ns = typeName.Namespace;
            foreach (XmlSchema schema in currentSchemas)
            {
                if (NamespacesEqual(ns, schema.TargetNamespace))
                {
                    return schema;
                }
            }
            return null;
        }