Esempio n. 1
0
        XmlCompletionDataCollection GetAttributeCompletionData(XmlSchemaComplexContentRestriction restriction)
        {
            XmlCompletionDataCollection data = new XmlCompletionDataCollection();

            data.AddRange(GetAttributeCompletionData(restriction.Attributes));

            XmlSchemaComplexType baseComplexType = FindNamedType(schema, restriction.BaseTypeName);
            if (baseComplexType != null)
            {
                data.AddRange(GetAttributeCompletionData(baseComplexType));
            }

            return data;
        }
Esempio n. 2
0
        XmlCompletionDataCollection GetChildElementCompletionData(XmlSchemaComplexContentExtension extension, string prefix)
        {
            XmlCompletionDataCollection data = new XmlCompletionDataCollection();

            XmlSchemaComplexType complexType = FindNamedType(schema, extension.BaseTypeName);
            if (complexType != null)
            {
                data = GetChildElementCompletionData(complexType, prefix);
            }

            // Add any elements.
            if (extension.Particle != null)
            {
                XmlSchemaSequence sequence = extension.Particle as XmlSchemaSequence;
                XmlSchemaChoice choice = extension.Particle as XmlSchemaChoice;
                XmlSchemaGroupRef groupRef = extension.Particle as XmlSchemaGroupRef;

                if (sequence != null)
                {
                    data.AddRange(GetChildElementCompletionData(sequence.Items, prefix));
                }
                else if (choice != null)
                {
                    data.AddRange(GetChildElementCompletionData(choice.Items, prefix));
                }
                else if (groupRef != null)
                {
                    data.AddRange(GetChildElementCompletionData(groupRef, prefix));
                }
            }

            return data;
        }
Esempio n. 3
0
        XmlCompletionDataCollection GetAttributeCompletionData(XmlSchemaElement element)
        {
            XmlCompletionDataCollection data = new XmlCompletionDataCollection();

            XmlSchemaComplexType complexType = GetElementAsComplexType(element);

            if (complexType != null)
            {
                data.AddRange(GetAttributeCompletionData(complexType));
            }

            return data;
        }
Esempio n. 4
0
        XmlCompletionDataCollection GetAttributeValueCompletionData(XmlSchemaSimpleType simpleType)
        {
            XmlCompletionDataCollection data = new XmlCompletionDataCollection();

            XmlSchemaSimpleTypeRestriction simpleTypeRestriction = simpleType.Content as XmlSchemaSimpleTypeRestriction;
            XmlSchemaSimpleTypeUnion union = simpleType.Content as XmlSchemaSimpleTypeUnion;
            XmlSchemaSimpleTypeList list = simpleType.Content as XmlSchemaSimpleTypeList;

            if (simpleTypeRestriction != null)
            {
                data.AddRange(GetAttributeValueCompletionData(simpleTypeRestriction));
            }
            else if (union != null)
            {
                data.AddRange(GetAttributeValueCompletionData(union));
            }
            else if (list != null)
            {
                data.AddRange(GetAttributeValueCompletionData(list));
            }

            return data;
        }
Esempio n. 5
0
        XmlCompletionDataCollection GetAttributeValueCompletionData(XmlSchemaSimpleTypeList list)
        {
            XmlCompletionDataCollection data = new XmlCompletionDataCollection();

            if (list.ItemType != null)
            {
                data.AddRange(GetAttributeValueCompletionData(list.ItemType));
            }
            else if (list.ItemTypeName != null)
            {
                XmlSchemaSimpleType simpleType = FindSimpleType(list.ItemTypeName);
                if (simpleType != null)
                {
                    data.AddRange(GetAttributeValueCompletionData(simpleType));
                }
            }

            return data;
        }
Esempio n. 6
0
        XmlCompletionDataCollection GetAttributeValueCompletionData(XmlSchemaAttribute attribute)
        {
            XmlCompletionDataCollection data = new XmlCompletionDataCollection();

            if (attribute.SchemaType != null)
            {
                XmlSchemaSimpleTypeRestriction simpleTypeRestriction = attribute.SchemaType.Content as XmlSchemaSimpleTypeRestriction;
                if (simpleTypeRestriction != null)
                {
                    data.AddRange(GetAttributeValueCompletionData(simpleTypeRestriction));
                }
            }
            else if (attribute.AttributeSchemaType != null)
            {
                XmlSchemaSimpleType simpleType = attribute.AttributeSchemaType as XmlSchemaSimpleType;

                if (simpleType != null)
                {
                    if (simpleType.Name == "boolean")
                    {
                        data.AddRange(GetBooleanAttributeValueCompletionData());
                    }
                    else
                    {
                        data.AddRange(GetAttributeValueCompletionData(simpleType));
                    }
                }
            }

            return data;
        }
Esempio n. 7
0
        XmlCompletionDataCollection GetAttributeValueCompletionData(XmlSchemaSimpleTypeUnion union)
        {
            XmlCompletionDataCollection data = new XmlCompletionDataCollection();

            foreach (XmlSchemaObject schemaObject in union.BaseTypes)
            {
                XmlSchemaSimpleType simpleType = schemaObject as XmlSchemaSimpleType;
                if (simpleType != null)
                {
                    data.AddRange(GetAttributeValueCompletionData(simpleType));
                }
            }

            return data;
        }
Esempio n. 8
0
        XmlCompletionDataCollection GetAttributeValueCompletionData(XmlSchemaElement element, string name)
        {
            XmlCompletionDataCollection data = new XmlCompletionDataCollection();

            XmlSchemaComplexType complexType = GetElementAsComplexType(element);
            if (complexType != null)
            {
                XmlSchemaAttribute attribute = FindAttribute(complexType, name);
                if (attribute != null)
                {
                    data.AddRange(GetAttributeValueCompletionData(attribute));
                }
            }

            return data;
        }
Esempio n. 9
0
        XmlCompletionDataCollection GetAttributeCompletionData(XmlSchemaObjectCollection attributes)
        {
            XmlCompletionDataCollection data = new XmlCompletionDataCollection();

            foreach (XmlSchemaObject schemaObject in attributes)
            {
                XmlSchemaAttribute attribute = schemaObject as XmlSchemaAttribute;
                XmlSchemaAttributeGroupRef attributeGroupRef = schemaObject as XmlSchemaAttributeGroupRef;
                if (attribute != null)
                {
                    if (!IsProhibitedAttribute(attribute))
                    {
                        AddAttribute(data, attribute);
                    }
                    else
                    {
                        prohibitedAttributes.Add(attribute);
                    }
                }
                else if (attributeGroupRef != null)
                {
                    data.AddRange(GetAttributeCompletionData(attributeGroupRef));
                }
            }
            return data;
        }
Esempio n. 10
0
        XmlCompletionDataCollection GetAttributeCompletionData(XmlSchemaSimpleContentExtension extension)
        {
            XmlCompletionDataCollection data = new XmlCompletionDataCollection();

            data.AddRange(GetAttributeCompletionData(extension.Attributes));

            return data;
        }
Esempio n. 11
0
        XmlCompletionDataCollection GetAttributeCompletionData(XmlSchemaSimpleContent simpleContent)
        {
            XmlCompletionDataCollection data = new XmlCompletionDataCollection();

            XmlSchemaSimpleContentExtension extension = simpleContent.Content as XmlSchemaSimpleContentExtension;
            if (extension != null)
            {
                data.AddRange(GetAttributeCompletionData(extension));
            }

            return data;
        }
Esempio n. 12
0
        XmlCompletionDataCollection GetAttributeCompletionData(XmlSchemaComplexType complexType)
        {
            XmlCompletionDataCollection data = new XmlCompletionDataCollection();

            data = GetAttributeCompletionData(complexType.Attributes);

            // Add any complex content attributes.
            XmlSchemaComplexContent complexContent = complexType.ContentModel as XmlSchemaComplexContent;
            if (complexContent != null)
            {
                XmlSchemaComplexContentExtension extension = complexContent.Content as XmlSchemaComplexContentExtension;
                XmlSchemaComplexContentRestriction restriction = complexContent.Content as XmlSchemaComplexContentRestriction;
                if (extension != null)
                {
                    data.AddRange(GetAttributeCompletionData(extension));
                }
                else if (restriction != null)
                {
                    data.AddRange(GetAttributeCompletionData(restriction));
                }
            }
            else
            {
                XmlSchemaSimpleContent simpleContent = complexType.ContentModel as XmlSchemaSimpleContent;
                if (simpleContent != null)
                {
                    data.AddRange(GetAttributeCompletionData(simpleContent));
                }
            }

            return data;
        }