public ResourceSyntaxModeProvider() { Assembly assembly = typeof(SyntaxMode).Assembly; Stream syntaxModeStream = assembly.GetManifestResourceStream("Revsoft.TextEditor.Resources.SyntaxModes.xml"); if (syntaxModeStream != null) { syntaxModes = SyntaxMode.GetSyntaxModes(syntaxModeStream); } else { syntaxModes = new List <SyntaxMode>(); } }
public void UpdateSyntaxModeList() { string 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); } }