예제 #1
0
        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>();
            }
        }
예제 #2
0
        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);
            }
        }