//static XmlSchemaSet schemaSet; //static XmlSchemaSet SchemaSet { // get { // if (schemaSet == null) { // schemaSet = HighlightingLoader.LoadSchemaSet(new XmlTextReader( // Resources.OpenStream("ModeV1.xsd"))); // } // return schemaSet; // } //} public static XshdSyntaxDefinition LoadDefinition(XmlReader reader, bool skipValidation) { reader = HighlightingLoader.GetValidatingReader(reader, false); XmlDocument document = new XmlDocument(); document.Load(reader); V1Loader loader = new V1Loader(); return(loader.ParseDefinition(document.DocumentElement)); }
private static Exception Error(IXmlLineInfo lineInfo, string message) { if (lineInfo != null) { return(new HighlightingDefinitionInvalidException(HighlightingLoader.FormatExceptionMessage(message, lineInfo.LineNumber, lineInfo.LinePosition))); } else { return(new HighlightingDefinitionInvalidException(message)); } }
//static XmlSchemaSet schemaSet; //static XmlSchemaSet SchemaSet //{ // get // { // if (schemaSet == null) // { // schemaSet = HighlightingLoader.LoadSchemaSet(XmlReader.Create( // Resources.OpenStream("ModeV2.xsd"))); // } // return schemaSet; // } //} public static XshdSyntaxDefinition LoadDefinition(XmlReader reader, bool skipValidation) { reader = HighlightingLoader.GetValidatingReader(reader, true); reader.Read(); return(ParseDefinition(reader)); }