예제 #1
0
 public void AddRange(XmlSchemaCompletionCollection schemas)
 {
     for (var i = 0; i < schemas.Count; i++)
     {
         Add(schemas[i]);
     }
 }
예제 #2
0
        XmlSchemaCompletionCollection GetSchemaCollectionUsingDefaultSchema(XmlElementPath path, XmlSchemaCompletion defaultSchema)
        {
            var schemas = new XmlSchemaCompletionCollection();

            if (defaultSchema != null)
            {
                path.SetNamespaceForUnqualifiedNames(defaultSchema.NamespaceUri);
                schemas.Add(defaultSchema);
            }
            return(schemas);
        }
예제 #3
0
        //public XmlSchemaCompletion GetSchemaFromFileName(string fileName)
        //{
        //    foreach (XmlSchemaCompletion schema in this) {
        //        if (FileUtility.IsEqualFileName(schema.FileName, fileName)) {
        //            return schema;
        //        }
        //    }
        //    return null;
        //}

        public XmlSchemaCompletionCollection GetSchemas(string namespaceUri)
        {
            var schemas = new XmlSchemaCompletionCollection();

            foreach (var schema in this)
            {
                if (schema.NamespaceUri == namespaceUri)
                {
                    schemas.Add(schema);
                }
            }
            return(schemas);
        }
        public XmlCodeCompletionBinding(string xsdResourceName)
        {
            if (xsdResourceName == null)
            {
                throw new ArgumentNullException(nameof(xsdResourceName));
            }

            _schemas = new XmlSchemaCompletionCollection();

            var rsRefs = xsdResourceName.Split(';');

            var rsAssembly = rsRefs.Length == 2 ? Assembly.Load(rsRefs[1]) : Assembly.GetExecutingAssembly();

            var st = rsAssembly.GetManifestResourceStream(rsRefs[0]);

            if (st != null)
            {
                using (var reader = new System.IO.StreamReader(st))
                {
                    _schemas.Add(new XmlSchemaCompletion(reader));
                }
            }
        }
예제 #5
0
 public XmlSchemaCompletionCollection(XmlSchemaCompletionCollection schemas)
 {
     AddRange(schemas);
 }