/// <summary>
        /// Checks whether the element belongs to the XSD namespace.
        /// </summary>
        static bool IsXmlSchemaNamespace(XmlSchemaElement element)
        {
            XmlQualifiedName qualifiedName = element.QualifiedName;

            if (qualifiedName != null)
            {
                return(XmlSchemaManager.IsXmlSchemaNamespace(qualifiedName.Namespace));
            }
            return(false);
        }
        /// <summary>
        /// Sets the default schema and namespace prefix that the xml editor will use.
        /// </summary>
        void SetDefaultSchema(string fileName)
        {
            if (fileName == null)
            {
                return;
            }
            string extension = Path.GetExtension(fileName).ToLower();

            view.DefaultSchemaCompletionData = XmlSchemaManager.GetSchemaCompletionData(extension);
            view.DefaultNamespacePrefix      = XmlSchemaManager.GetNamespacePrefix(extension);
        }
Esempio n. 3
0
        void SetDefaultSchema(string extension)
        {
            if (extension == null)
            {
                return;
            }

            defaultSchemaCompletionData = XmlSchemaManager.GetSchemaCompletionData(extension);
            if (defaultSchemaCompletionData != null)
            {
                inferredCompletionData = null;
            }
            else
            {
                QueueInference();
            }
            defaultNamespacePrefix = XmlSchemaManager.GetNamespacePrefix(extension);
        }
        void SetDefaultSchema()
        {
            var filename = document.FileName;

            if (filename == null)
            {
                return;
            }

            defaultSchemaCompletionData = XmlSchemaManager.GetSchemaCompletionDataForFileName(filename);
            if (defaultSchemaCompletionData != null)
            {
                inferredCompletionData = null;
            }
            else
            {
                QueueInference();
            }
            defaultNamespacePrefix = XmlSchemaManager.GetNamespacePrefixForFileName(filename);
        }