Example #1
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);
        }
Example #2
0
        public XmlCompletionItemCollection GetElementCompletionForAllNamespaces(XmlElementPath path, XmlSchemaCompletion defaultSchema)
        {
            XmlElementPathsByNamespace pathsByNamespace = new XmlElementPathsByNamespace(path);

            return(GetElementCompletion(pathsByNamespace, defaultSchema));
        }