src/Misc/EFTools/XmlCore/Model/Validation/AttributeContentValidator.cs
/// <summary>
///     returns the XmlSchemaType from the given XmlSchemaElement.
/// </summary>
/// <param name="schemaElement"></param>
/// <returns></returns>
returns the XmlSchemaType from the given XmlSchemaElement.
returns the XmlSchemaType from the given XmlSchemaElement .
private XmlSchemaType GetXmlSchemaTypeFromXmlSchemaElement(XmlSchemaElement schemaElement)
        {
            var schemaType = schemaElement.SchemaType;
            if (schemaType == null)
            {
                schemaType = GetXmlSchemaObject(SchemaSet.GlobalTypes, schemaElement.SchemaTypeName) as XmlSchemaType;
            }
            if (schemaType == null)
            {
                if (SchemaSet.GlobalElements.Contains(schemaElement.QualifiedName))
                {
                    schemaElement = SchemaSet.GlobalElements[schemaElement.QualifiedName] as XmlSchemaElement;
                    schemaType = schemaElement.SchemaType;
                }
                if (schemaType == null)
                {
                    schemaType = GetXmlSchemaObject(SchemaSet.GlobalTypes, schemaElement.SchemaTypeName) as XmlSchemaType;
                }
            }
            Debug.Assert(schemaType != null, "Unable to find schema type " + schemaElement.SchemaTypeName + " in schemaSet's GlobalTypes");
            return schemaType;
        }
private XmlSchemaType GetXmlSchemaTypeFromXmlSchemaElement ( XmlSchemaElement schemaElement ) { var schemaType = schemaElement . SchemaType ; if ( schemaType == null ) { schemaType = GetXmlSchemaObject ( SchemaSet . GlobalTypes , schemaElement . SchemaTypeName ) as XmlSchemaType ; } if ( schemaType == null ) { if ( SchemaSet . GlobalElements . Contains ( schemaElement . QualifiedName ) ) { schemaElement = SchemaSet . GlobalElements [ schemaElement . QualifiedName ] as XmlSchemaElement ; schemaType = schemaElement . SchemaType ; } if ( schemaType == null ) { schemaType = GetXmlSchemaObject ( SchemaSet . GlobalTypes , schemaElement . SchemaTypeName ) as XmlSchemaType ; } } Debug . Assert ( schemaType != null , " " + schemaElement . SchemaTypeName + " " ) ; return schemaType ; }
returns the XmlSchemaType from the given XmlSchemaElement.
returns the XmlSchemaType from the given XmlSchemaElement .
// if this was null, the element we have may be a ref to a global element, so look in the global elements to find its type
None
schemaElement
XmlSchemaElement
None