/// <summary> /// Converts a set of schemas to a string array, each array item /// contains the schema converted to a string. /// </summary> static string[] GetSchemas(XmlSchemaSet schemaSet, ITextEditor editor) { List <string> schemas = new List <string>(); foreach (XmlSchema schema in schemaSet.Schemas()) { using (EncodedStringWriter writer = new EncodedStringWriter(Encoding.Default)) { // TODO : use encoding used in ITextEditor (property missing?) using (XmlTextWriter xmlWriter = CreateXmlTextWriter(writer, editor)) { schema.Write(xmlWriter); schemas.Add(writer.ToString()); } } } return(schemas.ToArray()); }
/// <summary> /// Converts a set of schemas to a string array, each array item /// contains the schema converted to a string. /// </summary> static string[] GetSchemas(XmlSchemaSet schemaSet, ITextEditor editor) { List<string> schemas = new List<string>(); foreach (XmlSchema schema in schemaSet.Schemas()) { using (EncodedStringWriter writer = new EncodedStringWriter(Encoding.Default)) { // TODO : use encoding used in ITextEditor (property missing?) using (XmlTextWriter xmlWriter = CreateXmlTextWriter(writer, editor)) { schema.Write(xmlWriter); schemas.Add(writer.ToString()); } } } return schemas.ToArray(); }
/// <summary> /// Converts a set of schemas to a string array, each array item /// contains the schema converted to a string. /// </summary> string[] GetSchemas(XmlSchemaSet schemaSet) { List<string> schemas = new List<string>(); foreach (XmlSchema schema in schemaSet.Schemas()) { using (EncodedStringWriter writer = new EncodedStringWriter(xmlEditor.TextEditorProperties.Encoding)) { using (XmlTextWriter xmlWriter = CreateXmlTextWriter(writer)) { schema.Write(xmlWriter); schemas.Add(writer.ToString()); } } } return schemas.ToArray(); }