示例#1
0
        private void DeactiveMonitorWords()
        {
            if (isList>-1)
            {
                CompletionList.OnInsert -= new InsertedTextHandler(CompletionList_OnInsert);
                isList = -1;
            }

            if (highlightWord != null)
            {
                QuickGenerator.CustomCompletionList.ExplorerProject.RemoveHighlights(sciMonitor);
                highlightWord.Stop();

                if (!_setting._showHighLight)
                {
                    highlightWord.Tick -= new EventHandler(highlightWord_Tick);
                    highlightWord = null;
                }
            }

            alreadyInvoke = false;

            ASContext.CommonSettings.DisableCodeReformat = reformater;

            if (declarationWord != null)
            {
                sciMonitor.TextInserted -= new TextInsertedHandler(DeclarationWordTextChange);
                sciMonitor.TextDeleted -= new TextDeletedHandler(DeclarationWordTextChange);
                declarationWord.NextWord = null;
                declarationWord = null;
            }

            if (importWord != null)
            {
                sciMonitor.TextInserted -= new TextInsertedHandler(DeclarationWordTextChange);
                sciMonitor.TextDeleted -= new TextDeletedHandler(DeclarationWordTextChange);
                importWord.NextWord = null;
                importWord = null;
            }

            if (sciMonitor != null)
            {

                sciMonitor.TextInserted -= new TextInsertedHandler(sciMonitor_TextInserted);
                sciMonitor.TextDeleted -= new TextDeletedHandler(sciMonitor_TextDeleted);
                sciMonitor.CharAdded -= new CharAddedHandler(sciMonitor_CharAdded);
                sciMonitor.FocusChanged -= new FocusHandler(sciMonitor_FocusChanged);
            //    sciMonitor.FocusChanged -= new FocusHandler(sciMonitor_FocusChanged);

                sciMonitor = null;

            }
            //if (tmChangeWordText != null)
            //{
            //    tmChangeWordText.Stop();
            //    tmChangeWordText.Tick -= new EventHandler(tmChangeWordText_Tick);
            //    tmChangeWordText = null;
            //}

            lastWord = null;
            curWord = null;
            secondLastWord = null;

            WordRegionBase wb = firstWord;

            WordRegionBase disp = null;

            while (wb != null)
            {

                disp = wb;
                wb = wb.NextWord;
                disp.Dispose();
            }

            Words.Clear();

            if(imports!=null)
            imports.Clear();
            if (eventsHandler != null)
            eventsHandler.Clear();

            if (AfterCurrentMember != null)
            AfterCurrentMember.Clear();

            lsVar.Clear();
            isMonitoring = false;
            firstWord = null;

            numCursors = 0;

            curIndWord = -1;

            if(currentForm!=null)
            {
                currentForm.FormClosed -= new System.Windows.Forms.FormClosedEventHandler(currentForm_FormClosed);
                currentForm=null;
            }
            if (MonitorOnWordsDeactive != null)
                MonitorOnWordsDeactive(this);
            return;
        }
示例#2
0
        private void ActiveMonitorWords()
        {
            fileName = ASContext.Context.CurrentClass.Name;
            sciMonitor = ASContext.CurSciControl;

            sciMonitor.TextInserted += new TextInsertedHandler(sciMonitor_TextInserted);
            sciMonitor.TextDeleted += new TextDeletedHandler(sciMonitor_TextDeleted);

            sciMonitor.CharAdded += new CharAddedHandler(sciMonitor_CharAdded);
            sciMonitor.FocusChanged += new FocusHandler(sciMonitor_FocusChanged);

            currentForm = (FlashDevelop.Docking.TabbedDocument)ASContext.MainForm.CurrentDocument;
            currentForm.FormClosed += new System.Windows.Forms.FormClosedEventHandler(currentForm_FormClosed);

            reformater =   ASContext.CommonSettings.DisableCodeReformat;
            ASContext.CommonSettings.DisableCodeReformat = true;
            isMonitoring = true;

            //CompletionList.OnInsert += new InsertedTextHandler(insert);

            if (_setting._showHighLight && highlightWord==null)
            {
                highlightWord = new System.Windows.Forms.Timer();
                highlightWord.Interval = 700;
                highlightWord.Tick += new EventHandler(highlightWord_Tick);

            }
            else if (!_setting._showHighLight && highlightWord != null)
            {
                highlightWord.Tick -= new EventHandler(highlightWord_Tick);
                highlightWord = null;

            }

            if(highlightWord!=null)
                highlightWord.Start();
        }