Beispiel #1
0
 /// <summary>
 /// Удалить лекстер
 /// </summary>
 public void DisposeLexter()
 {
     if (Lexter != null)
     {
         Lexter.Dispose();
     }
 }
Beispiel #2
0
        public void ChangeHighliting(string highlitingName)
        {
            SyntaxHighlighting = HighlightingManager.Instance.GetDefinition(highlitingName);
            if (SyntaxHighlighting == null)
            {
                SyntaxHighlighting = ExtendedHighlightingManager.Instance.GetDefinition(highlitingName);
                if (SyntaxHighlighting == null)
                {
                    if (Lexter != null)
                    {
                        Lexter.FoldingStrategy = null;
                    }
                }
            }

            switch (highlitingName)
            {
            case "XML":
                if (Lexter != null)
                {
                    Lexter.Dispose();
                }
                Lexter = new CustomLexter(this, new XmlFoldingStrategy(), new DefaultIndentationStrategy(), new CodeCompletionList(TextArea));
                break;

            case "C#":
            case "C++":
            case "PHP":
            case "Java":
                if (Lexter != null)
                {
                    Lexter.Dispose();
                }
                Lexter = new CustomLexter(this, new BraceFoldingStrategy(), new CSharpIndentationStrategy(Options), new CodeCompletionList(TextArea));
                break;

            case "VHDL":
                if (Lexter != null)
                {
                    Lexter.Dispose();
                }
                Lexter = new VHDL_Lexter(this);
                TextArea.TextView.LineTransformers.Add(new VHDL_ErrorColorizer(Lexter as VHDL_Lexter));
                TextArea.TextView.LineTransformers.Add(new VHDL_WarningColorizer(Lexter as VHDL_Lexter));
                break;

            case "Verilog":
                if (Lexter != null)
                {
                    Lexter.Dispose();
                }
                Lexter = new CustomLexter(this, new VerilogFoldingStrategy(), new VerilogIndentionStrategy(), new CodeCompletionList(TextArea));
                break;

            default:
                if (Lexter != null)
                {
                    Lexter.Dispose();
                }
                Lexter = new CustomLexter(this, null, new DefaultIndentationStrategy(), new CodeCompletionList(TextArea));
                break;
            }
        }