コード例 #1
0
        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)));
        }
コード例 #2
0
        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>();
            }
        }
コード例 #3
0
        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);
            }
        }