XmlSchemaObject FindSchemaObjectReference(QualifiedName qualifiedName, string elementName, XmlSchemaCompletion schema)
        {
            switch (elementName)
            {
            case "element":
                return(schema.FindRootElement(qualifiedName));

            case "attribute":
                return(schema.FindAttribute(qualifiedName.Name));

            case "group":
                return(schema.FindGroup(qualifiedName.Name));

            case "attributeGroup":
                return(schema.FindAttributeGroup(qualifiedName.Name));
            }
            return(null);
        }
 XmlSchemaAttribute FindSchemaObjectForSelectedAttribute(XmlSchemaCompletion schemaForSelectedElement, XmlSchemaElement selectedSchemaElement)
 {
     return(schemaForSelectedElement.FindAttribute(selectedSchemaElement, selectedElement.SelectedAttribute));
 }