示例#1
0
        public LanguageBinding(EditorTab editorTab)
        {
            this.editorTab = editorTab;
            stopWatch      = new Stopwatch();
            editorTab.editor.TextChanged                             += new EventHandler(editor_TextChanged);
            editorTab.editor.Caret.PositionChanged                   += new EventHandler(Caret_PositionChanged);
            editorTab.editor.OnHighlighterChangedHandler             += new HighlighterChangedEventHandler(editor_OnHighlighterChangedHandler);
            editorTab.editor.ActiveTextAreaControl.TextArea.KeyPress += new KeyPressEventHandler(TextArea_KeyPress);
            Application.Idle += new EventHandler(Application_Idle);

            #region Create Language bindings
            PHPBinding  = new PHPLanguageBinding(editorTab.editor);
            HTMLBinding = new HTMLLanguageBinding(editorTab.editor);
            JSBinding   = new JSLanguageBinding(editorTab.editor);
            CSSBinding  = new CSSLanguageBinding(editorTab.editor);
            #endregion

            HtmlCompletion = new HtmlCompletionClass(editorTab.editor);
            QuickTemplate  = new QuickletEngine();

            //Aktiviert das richtige Binding
            editor_OnHighlighterChangedHandler(null, new HighlighterChangedEventArgs(editorTab.editor.DocLanguage));

            if (editorTab.editor.Document.FoldingManager.FoldingStrategy != null)
            {
                editorTab.editor.Document.FoldingManager.UpdateFoldings(null, null);
            }
        }
示例#2
0
 public void Dispose()
 {
     Application.Idle -= editor_TextChanged;
     stopWatch         = null;
     PHPBinding        = null;
     HTMLBinding.Dispose();
 }