/// <summary> /// Loads the specified schema and adds it to an internal collection. /// </summary> /// <remarks>The schema file is not copied to the user's schema folder /// until they click the OK button.</remarks> void AddSchema(XmlSchemaCompletion schema) { XmlSchemaListItem schemaListItem = new XmlSchemaListItem(schema.NamespaceUri, false); int index = schemasPanel.AddXmlSchemaListItem(schemaListItem); schemasPanel.SelectedXmlSchemaListItemIndex = index; addedSchemas.Add(schema); schemasChanged = true; }
XmlSchemaCompletionCollection GetSchemaCollectionUsingDefaultSchema(XmlElementPath path, XmlSchemaCompletion defaultSchema) { XmlSchemaCompletionCollection schemas = new XmlSchemaCompletionCollection(); if (defaultSchema != null) { path.SetNamespaceForUnqualifiedNames(defaultSchema.NamespaceUri); schemas.Add(defaultSchema); } return(schemas); }
public XmlSchemaCompletionCollection GetSchemas(string namespaceUri) { XmlSchemaCompletionCollection schemas = new XmlSchemaCompletionCollection(); foreach (XmlSchemaCompletion schema in this) { if (schema.NamespaceUri == namespaceUri) { schemas.Add(schema); } } return(schemas); }