Beispiel #1
0
        public XmlCompletionItemCollection GetAttributeCompletion(XmlElementPath path, XmlSchemaCompletion defaultSchema)
        {
            XmlCompletionItemCollection items = new XmlCompletionItemCollection();

            foreach (XmlSchemaCompletion schema in GetSchemas(path, defaultSchema))
            {
                items.AddRange(schema.GetAttributeCompletion(path));
            }
            return(items);
        }
Beispiel #2
0
        public XmlCompletionItemCollection GetAttributeValueCompletion(XmlElementPath path, string attributeName, XmlSchemaCompletion defaultSchema)
        {
            path.Compact();
            XmlCompletionItemCollection items = new XmlCompletionItemCollection();

            foreach (XmlSchemaCompletion schema in GetSchemas(path, defaultSchema))
            {
                items.AddRange(schema.GetAttributeValueCompletion(path, attributeName));
            }
            return(items);
        }
Beispiel #3
0
        public XmlCompletionItemCollection GetElementCompletion(XmlElementPathsByNamespace pathsByNamespace, XmlSchemaCompletion defaultSchema)
        {
            XmlCompletionItemCollection items = new XmlCompletionItemCollection();

            foreach (XmlElementPath path in pathsByNamespace)
            {
                items.AddRange(GetChildElementCompletion(path, defaultSchema));
            }

            XmlNamespaceCollection namespaceWithoutPaths = pathsByNamespace.NamespacesWithoutPaths;

            if (items.Count == 0)
            {
                if (!IsDefaultSchemaNamespaceDefinedInPathsByNamespace(namespaceWithoutPaths, defaultSchema))
                {
                    namespaceWithoutPaths.Add(defaultSchema.Namespace);
                }
            }
            items.AddRange(GetRootElementCompletion(namespaceWithoutPaths));
            return(items);
        }
Beispiel #4
0
        public XmlCompletionItemCollection GetRootElementCompletion(XmlNamespaceCollection namespaces)
        {
            XmlCompletionItemCollection items = new XmlCompletionItemCollection();

            foreach (XmlNamespace ns in namespaces)
            {
                foreach (XmlSchemaCompletion schema in GetSchemas(ns.Name))
                {
                    items.AddRange(schema.GetRootElementCompletion(ns.Prefix));
                }
            }
            return(items);
        }