示例#1
0
 public void LoadFile(string fn)
 {
     Editor.LoadFile(fn);             // auto-sets syntax highlighting mode
     // TextEditorControl clears highlighting if file extension was unknown
     if (fn.EndsWith(".ecs") || fn.EndsWith(".les"))
     {
         Editor.SetHighlighting("C#");                 // there, FTFY
     }
     // Modified flag is set during loading because the document
     // "changes" (from nothing to something). So, clear it again.
     SetModifiedFlag(false);
 }
示例#2
0
        public void ChooseHighlighter()
        {
            var fn = Editor.FileName.ToLower();

            if (fn.EndsWith(".ecs") || fn.EndsWith(".les"))
            {
                Editor.SetHighlighting("C#");                 // there, FTFY
            }
            else
            {
                Editor.Document.HighlightingStrategy =
                    HighlightingStrategyFactory.CreateHighlightingStrategyForFile(fn);
            }
        }