public XmlTextReader GetSyntaxModeFile(SyntaxMode syntaxMode) { var syntaxModeFile = Path.Combine(directory, syntaxMode.FileName); if (!File.Exists(syntaxModeFile)) { throw new HighlightingDefinitionInvalidException("Can't load highlighting definition " + syntaxModeFile + " (file not found)!"); } return(new XmlTextReader(File.OpenRead(syntaxModeFile))); }
public ResourceSyntaxModeProvider() { var assembly = typeof(SyntaxMode).Assembly; var syntaxModeStream = assembly.GetManifestResourceStream("LiteDB.Studio.ICSharpCode.TextEditor.Resources.SyntaxModes.xml"); if (syntaxModeStream != null) { syntaxModes = SyntaxMode.GetSyntaxModes(syntaxModeStream); } else { syntaxModes = new List <SyntaxMode>(); } }
public void UpdateSyntaxModeList() { var syntaxModeFile = Path.Combine(directory, "SyntaxModes.xml"); if (File.Exists(syntaxModeFile)) { Stream s = File.OpenRead(syntaxModeFile); syntaxModes = SyntaxMode.GetSyntaxModes(s); s.Close(); } else { syntaxModes = ScanDirectory(directory); } }